The origin of ferroelectric polarization in the tetragonal tungsten-bronze-type oxide strontium barium niobate (SBN) is investigated using first-principles density functional calculations. We study in particular the relationship between the polarization and the cation and vacancy ordering on the alkali earth lattice sites. Lattice dynamical calculations for paraelectric structures demonstrate that all cation configurations that can be accommodated in a 1 × 1 × 2 supercell result in a single unstable polar phonon, composed primarily of relative Nb-O displacements along the polar axis, as their dominant instability. The majority of the configurations also have a second octahedral tilt-mode instability which couples weakly to the polar mode. The existence of the tilt mode is strongly dependent on the local cation ordering, consistent with the fact that it is not found experimentally. Our results suggest that ferroelectricity in the SBN system is driven by a conventional second-order Jahn-Teller mechanism caused by the d 0 Nb 5+ cations, and demonstrate the strong influence of the size of Sr and Ba on the lattice distortions associated with polarization and octahedral tilting. Finally, we suggest a mechanism for the relaxor behavior in Sr-rich SBN based on Sr displacement inside pentagonal channels in the TTB structure. PACS numbers: 71.15.Mb, 77.80.Jk, 77.80.bg Ferroelectric oxides with tetragonal tungsten-bronze (TTB) structure have been known since 1953 [3], and their polar properties are both widely studied and used in applications. One of the simplest TTB compounds, lead metaniobate (Pb 5 Nb 10 O 30 or PN), is commercially available and attractive for hightemperature piezoelectric sensor applications. In spite of their popularity, however, a fundamental explanation of the mechanism leading to spontaneous polarization in TTBs has to our knowledge not been reported. One possible origin is Nb 5+ , which is a ferroelectrically active cation in perovskites owing to a second-order Jahn-Teller mechanism enabled by its d 0 electron configuration [4,5]. Fundamental studies on TTBs are challenging, partly due to multiple competing phases: PN, for example, is at ambient temperature metastable in the TTB structure with respect to a rhombohedral polymorph [6][7][8]. Most other tungsten-bronze oxides are solid solutions with structural and chemical disorder, consistent with many of them being relaxor-type ferroelectrics [9][10][11].The aristotype unit cell with the general formula (A1) 2 (A2) 4 C 4 (B1) 2 (B2) 8 O 30 has six sites available for A-type cations and ten for B-type. The structure is highly anisotropic, with the A1 and A2 sites forming channels along the c direction. The A1 sites are formally 12-coordinated and similar to the A sites in perovskites, while the A2 sites are pentagonal and formally 15-coordinated. The B1 and B2 sites are octahedrally coordinated, with corner-sharing BO 6 octahedra forming the structural framework. Many niobates and tantalates crystallize as TTBs where Nb or Ta resides on the octa...