In this work a three-phase constitutive model of Shape Memory Alloys which is capable of handling complicated thermomechanical loading paths is presented. Shape Memory Alloys are materials, which change their crystallographic structure due to changes in temperature and/or applied loads. The effective use of SMAs in industrial applications requires accurate constitutive models capable of predicting their response over a wide range of thermomechanical loading paths. The model presented in this work is based on thermodynamic potentials and differentiates between three different phases - self accommodated (twinned) martensite, stress-induced (detwinned) martensite, and austenite. The distinction between twinned and detwinned martensite allows for the introduction of different transformation surfaces, evolution equations and hardening laws for the stress induced, thermally induced phase transformations and reorientation of martensite in a natural way. A phase-diagram based description of the transformation surfaces is used in stress-temperature space. The proposed phase diagram extends the work of previous authors by completing the transformation surfaces so that the model is consistent when a thermomechanical loading path involves mixtures of the three phases. It also captures some recent experimental observations. The model is tested on a range of complicated, uniaxial, thermomechanical loading paths such as constrained cooling and/or heating of a SMA rod starting from different initial conditions. These types of loading paths are chosen because they typically involve more than one simultaneous transformation. Comparisons with experimental results are also performed. The model is numerically implemented in 3D using return mapping algorithms. Its capabilities to predict the SMA behavior over a wide range of thermal and mechanical loading conditions are demonstrated by a Finite Element Analysis of a thermally actuated flow regulation device.