The planet was first colonized in 1,989 BBY when Lord Ecclessis Figg first commissioned Cloud City, to be built by the Incom Corporation at the same time. The planet had its own Jedi Enclave. During the New Sith Wars, the Brotherhood of Darkness captured the planet.
In 22 BBY, the planet served as a refuge for children orphaned by the Clone Wars, but it was soon conquered by the Confederacy itself. It was a great loss for the entire Galactic Republic; the Confederacy had secured the Tibanna gas refineries that were the main source of energy for the Republic's turbolasers aboard capital ships.
Sometime during the Galactic Civil War, Lando Calrissian served as Baron Administrator of Cloud City. He helped provide well-paying jobs for the Ugnaughts, and was admired and liked by the citizens of Cloud City.
When Han Solo, along with Leia Organa, C-3PO, and Chewbacca came to Cloud City in 3 ABY to escape from the Empire, they walked into a trap set up by Darth Vader, which Lando was forced into aiding. Han Solo was frozen into Carbonite and Leia Organa and Chewbacca were to remain in the city. As Boba Fett brought Han onto his ship, Slave I, Lando with Lobot's help, got the two out of Imperial controller along with blasted Threepio and tried to rescue Han from Fett but failed.
Meanwhile, Luke Skywalker dueled Vader, lost his right hand, and Vader revealed that he was Luke's father. Pinned between the choice of going with his long-lost father or dying by his blade, Luke plunged into an air vent. When he fell, he managed to grasp onto a weather vane beneath the city. In pain from his wound and his new knowledge, Luke pleaded for Obi-Wan Kenobi's help, to no avail. He managed to telepathically communicate with Leia, and was rescued by the Millennium Falcon. The Falcon in turn managed to escape from the Executor when R2-D2 fixed the disabled hyperdrive.
A garrison of Imperial troops was left on the planet. Lobot temporarily ousted the garrison from the planet by tricking them into thinking Cloud City's repulsorlift pods were compromised. Lobot was executed by the Empire when the garrison commander regained control of the city.
Later, just before the Battle of Endor, the Alliance attempted to remove the renewed Imperial presence there by leading Rogue Squadron and the Rebel SpecForce against the Empire in the Battle of Bespin. Neither side was able to gain an upper hand and claim a victory. The Battle ended in a stale mate.
During the stalemate Tibana gas production and all trade in and out of the system came to a halt. With no medical or food supplies entering the city, mass rioting broke out. Imperial and Rebel forces attempted to continue their battle amid the riots, believing that reinforcements were on the way. Due to the Battle of Endor, they never arrived. Imperial, Rebel & city leaders sensing the city was about to tear itself apart brokered an uneasy cease fire agreement.
Today, Imperial forces retain control the system and ensure Tibana gas productions remain stable. The Bespin Wing Command maintains control and oversees much of the day to day civilian policing activities; both are deeply corrupted and heavily influenced by the local crime organizations. Rebel factions still function within the city, but use it mainly as an R&R planet and supply line.