Mostar is named for its bridge keepers, the mostari, who guarded a bridge over the Neretva. The name first appears in a document of 1474, though a bridge is already recorded in 1454. Traders moving between the Adriatic coast and the mining country of central Bosnia used the crossing, so the town spread onto the right bank.
The Ottomans took the region in 1468 and called the settlement Köprühisar, the fortress at the bridge. It was split into a čaršija for crafts and trade, and a mahala for homes. Between 1520 and 1566 the town was fortified and the wooden bridge replaced in stone. The architect Hayruddin, a pupil of the great Sinan, designed the new arch. The traveller Evliya Çelebi wrote in the 17th century that he had crossed 16 countries and never seen so high a bridge.
Austria-Hungary ruled from 1878 to 1918 and redrew the west bank. Broad avenues and a street grid were laid out there, and the architects put up Hotel Neretva, the municipality building and the Gimnazija of 1902. The Catholic diocese of Mostar-Duvno has had its seat here since 1881.
Under socialist Yugoslavia, Mostar built plants for aluminium, textiles and metalworking, and its population rose from 18,000 in 1945 to 100,000 in 1980. Large residential blocks went up on the west bank. In the 1970s and 1980s the municipality also ran a conservation plan for the old town, and the Aga Khan Award for Architecture went to Mostar for it in 1986. The 1991 census counted 127,000 people, split almost evenly between Bosniaks and Croats, with 18.8% Serbs.
War came in 1992 with a siege by the Yugoslav army, then turned inward. By mid-April 1993 Mostar was split, with Croat forces in the west and the Bosnian army in the east, and the front line ran along the river. About 2,000 people died. Twelve of the city's 14 mosques were destroyed or badly damaged, along with the Catholic cathedral and the Franciscan monastery. The Old Bridge fell in 1993.
Rebuilding began in 1999 and the bridge reopened on 23 July 2004. Spain, which had peacekeepers nearby, gave money, as did Turkey, Italy, the Netherlands, Croatia and the United States. Original stones were recovered from the river. In July 2005 UNESCO listed the bridge and its surroundings. The Stari Grad Agency now looks after the restored buildings.
Rebuilding stone was easier than rebuilding trust. In 2010 the Constitutional Court struck down Mostar's election rules as discriminatory. Without a legal basis, no local vote took place in 2012 or 2016, and rubbish collection suffered. Legal changes in July 2020 finally allowed an election on 20 December 2020.