The territory was organized by an organic act of Congress in 1850, on the same day that the State of California was admitted to the Union. The creation of the territory was part of the Compromise of 1850 that sought to preserve the balance of power between slave and free states. With the exception of a small area around the headwaters of the Colorado River in present-day Colorado which had been acquired from Spain with the Adams-Onís Treaty of 1819, the United States had acquired all the land of the territory from Mexico with the Treaty of Guadalupe Hidalgo of 1848.
The creation of the Utah Territory was partially the result of the petition sent by the Mormon pioneers who had settled in the valley of the Great Salt Lake starting in 1847. The Mormons, under the leadership of Brigham Young, had petitioned Congress for entry into the Union as the State of Deseret, with its capital as Salt Lake City and with proposed borders that encompassed the entire Great Basin and the watershed of the Colorado River, including all or part of nine current U.S. states. The Mormon settlers had drafted a state constitution in 1849 and Deseret had become the de facto government in the Great Basin by the time of the creation of the Utah Territory.
Following the organization of the territory, Young was inaugurated as its first governor on February 3, 1851. In the first session of the territorial legislature in October, the legislature adopted all the laws and ordinances previously enacted by the General Assembly of the State of Deseret.
Mormon governance in the territory was regarded as controversial by much of the rest of the nation, partly fed by continuing lurid newspaper depictions of the polygamy practiced by the settlers, which itself had been part of the cause of their flight from the United States to the Great Salt Lake basin after being forcibly removed from their settlements farther east.
Although the Mormons were the majority in the Great Salt Lake basin, the western area of the territory began to attract many non-Mormon settlers, especially after the discovery of silver at the Comstock Lode in 1858. In 1861, partly as a result of this, the Nevada Territory was created out of the western part of the territory. Non-Mormons also entered the easternmost part of the territory during the Pikes Peak Gold Rush, resulting in the discovery of gold at Breckinridge in Utah Territory in 1859. In 1861 a large portion of the eastern area of the territory was reorganized as part of the newly created Colorado Territory.
The arrival of the railroad, simultaneously from California and the east in 1869, was not regarded as especially beneficial by the Mormons who governed the territory. The ceremony of the driving of the golden spike at Promontory Summit to complete the transcontinental railroad was boycotted by the territory officials, who were wary of the encroachment of the outside world into the basin of the Great Salt Lake.
The controversies stirred by the Mormon religion's dominance of the territory is regarded as the primary reason behind the long delay of 46 years between the organization of the territory and its admission to the Union in 1896 as the State of Utah, long after the admission of territories created after it. In contrast, the Nevada Territory, although more sparsely populated, was admitted to the Union in 1864, only three years after its formation, largely as a consequence of the Union's desire to consolidate its hold on the silver mines in the territory. Colorado was admitted in 1876.