We use first principles density functional theory to calculate electronic and magnetic properties of TiF3 using the full potential linearized augmented plane wave method. The LDA approximation predicts a fully saturated ferromagnetic metal and finds degenerate energy minima for high and low symmetry structures. The experimentally observed Jahn-Teller phase transition at Tc=370K can not be driven by the electron-phonon interaction alone, which is usually described accuratly by LDA. Electron correlations beyond LDA are essential to lift the degeneracy of the singly occupied Ti t$_{2g}$ orbital. The LDA+U functional predicts an aniferromagnetic insulator with a orbitally ordered ground state. The input parameters U=8.1 eV and J=0.9 eV for the Ti 3d orbital were found by varying the total charge on the TiF6^{2-} ion using the molecular NRLMOL code. We estimate the Heisenberg exchange constant for spin-1/2 on a cubic lattice to be approximately 24 K. The symmetry lowering energy in LDA+U is about 900 K per TiF3 formula unit.