The United Federation of Planets (abbreviated as UFP and often simply called the Federation) is an interstellar state formed as a union of many individual members who remain semi-autonomous. Its core territories were in the Alpha and Beta Quadrants of the Milky Way galaxy, though by the late 24th century, the Federation also maintained outposts in the Gamma Quadrant, and held non-contiguous territory in the Delta Quadrant as well.
The Federation was founded in the year 2161, following the resolution of the Earth-Romulan War, an outgrowth of the previous Coalition of Planets. Its founding members were Earth, Vulcan, Andoria, Tellar and Alpha Centauri. Over the next two centuries, Federation membership would swiftly grow, and it would become a major political and technological superpower. As of 2373, the Federation had more than 150 full members, and stretched across 8,000 light-years. Those figures would continue to grow over the next decade, and by the 2380s, Federation territory occupied more than 10,000 light-years in the Alpha and Beta Quadrants.
Starfleet was also chartered to perform defensive, diplomatic, exploratory and scientific duties for the Federation.
The main body of the Federation was surrounded by a number of neighboring bodies, including the Klingon and Romulan Empires, the Ferengi Alliance, the Tholian Assembly and others.
For much of its first century and a half, the Federation often found itself in conflict with the Klingon Empire, ranging from border skirmishes, to full-fledged war in the 2250s, to a protracted cold war which only began to abate after the Federation reached out to offer the Klingons aid following the destruction of Praxis in 2293. Despite the assassination of Chancellor Gorkon, the subsequent peace conference eventually led to the Khitomer Accords and a Treaty of Alliance between the Federation and the Empire.
The first half of the 24th century was marked as a time of exploration and steady, peaceful expansion for the Federation. However, by the middle of the century, the Federation was drawn into conflict with neighbors like the Cardassian Union and the Tzenkethi Coalition, breaking out into open war by the 2350s. What followed was a decidedly turbulent period for the Federation that lasted well into the next century. Those years saw continuing conflict with the Cardassians, and the reemergence of the Romulans on the galactic scene, followed by first contact with and repeated incursions by the Borg Collective, the birth of the Maquis terrorist group, the Klingon withdrawal from the Khitomer Accords, and disastrous contact with the a power from the Gamma Quadrant known as the Dominion.
The Alpha and Beta Quadrants were engulfed in the Dominion War for nearly three years, drawing in almost every interstellar power in known space. By the time the war ended in late 2375, the political landscape of the near side of the galaxy was shaken to its core. The Klingons had returned to their alliance with the Federation, and the two powers had in turn allied with the Romulans to defeat the Dominion, aided by the Cardassian resistance. After the Dominion withdrew to their home territories in the Gamma Quadrant, the powers of the Alpha Quadrant Alliance entered a period of reconstruction, lasting from 2376 into the early 2380s.
In 2381, the Federation learned that the Romulan star was going to go supernova, with disastrous consequences for neighboring systems in the Beta Quadrant. While the Vulcan Science Council considered ways to mitigate the damage, the Starfleet and the UFP began working towards evacuating people from the affected systems. This led to thousands of Romulan refugees being relocated, but the relief efforts ended in 2385 when the bulk of the evacuation fleet was obliterated by a rogue synth attack that destroyed the Utopia Planitia Fleet Yards and left Mars ablaze for decades to come. The Federation instituted a ban on synthetic lifeforms and withdrew into its borders, leaving the Romulans and the rest of the galaxy to fend for themselves. The Romulan supernova occurred two years later in 2387, causing untold devastation and the loss of countless lives.