The Mexican American War was caused by disputes over borders between the United States and Mexico. Mexico was unhappy with the increasing number of American settlers moving into lands owned by Mexico after 1803. The United States tried to purchase additional lands from Mexico in 1835 and 1845 but Mexico refused. Texas also gained independence from Mexico in 1835, further angering Mexico. When the United States annexed Texas as a state in 1845, Mexico broke off diplomatic relations. Armed conflict broke out in 1846 over conflicting claims to the Rio Grande borderlands, starting the Mexican American War.