Every Sunday, the Colombian capital closes more than 100km of roads to motor vehicles, and a wildebeest-worthy migration of bikes takes over the city.

Colombia embraced a new national hero in July when 23-year-old Nairo Quintana finished second in the Tour de France, the highest-ever finish by a Colombian cyclist in the world's most famous bike race.

But visit Colombia's capital Bogota, near where Quintana grew up, and it is easy to see how a grand cycling career was born here. Pinched between the Andes ranges and sitting 2,600m above sea level, Bogota is unexpectedly one of the world's great biking cities.

Despite the mountainous surrounds, South America's fourth-largest city is predominantly flat and the cycling infrastructure is excellent. Around 350km of bike paths – more than in any other Latin American city – radiate from the city centre, and every new street that is built must also include a bike lane. The TransMilenio rapid bus transit offers secure bicycle storage near major terminals, and it is law that parking lots must include space for bicycles.

"A citizen on a $30 bicycle is equally important to one in a $30,000 car," former Bogota mayor Enrique Peñalosa, a key advocate of the city's cycling infrastructure, declared in 1999. On taking office in 1998, Peñalosa scrapped plans for a new highway, investing the money instead in bike lanes and the bus system.

Cycling's impact on this enormous city of seven million people is easy to see. On most Wednesday nights for the last seven years, hundreds of cyclists have joined in the Ciclopaseo ride, a Critical Mass-style pedal through the city streets that is about the fun of riding and also stands as a political message about cycling rights in the city.

But Bogota's greatest gift to cyclists is unquestionably Ciclovia. For seven hours every Sunday, the city closes more than 100km of roads to motor vehicles, and a wildebeest-worthy migration of bikes and pedestrians takes over the city.

Translating as “bike way”, the Ciclovia concept began in Bogota almost 40 years ago. It is an idea that has spread to cities around the world, such as Ottawa, Mexico City and Paris, but it started in Colombia when the streets were handed over to cyclists on a Sunday in the mid-1970s to encourage cycling in a safe environment. They were never handed back.

Locals remember a time when a past mayor proposed an end to Ciclovia – and was met with citywide resistance. Today, it is as much an accepted part of a Bogota Sunday as a tamale (a local favourite of rice, chicken, pork, egg and vegetables wrapped in a palm leaf) for breakfast.

At 7am the streets close and cyclists flood in from the wealthier northern suburbs, through the popular visitor district of Zona Rosa to reach La Septima, one of Bogota’s major thoroughfares. At this point, Ciclovia becomes a vast cast of human-powered transport.

Estimates of the numbers of people who partake each week vary from one million to two million, and the city fills with mountain bikes, road bikes, fold-up bicycles and children on training bikes. There are cyclists in team-name Lycra and others pedalling in flip-flops. There are hundreds of joggers and dozens of rollerbladers. There are small dogs in baskets, and large dogs towing youths on skateboards. It is a snapshot of Bogota simultaneously at rest and play.

Mobile bike mechanics set up camp every few hundred metres along the road, prepared to do a roaring trade in punctures and repairs. Roadside carts sell snacks and drinks, from fruit punch to arepas (corn cakes) and salted green mango.

Approaching the city centre, the ride passes through the greenery of Parque Nacional, where Ciclovia started with the Sunday closure of the park’s roads. Mechanics and vendors congregate in a line along the road’s edge; mountain bikers catapult through the park, and hundreds of people partake in Recrovia , Ciclovia's free aerobics and dance classes. At no other time do you see Bogota this relaxed.

Among the cyclists are white-shirted “guardians” who are employed to control the ride. When the city first tried to employ Ciclovia guardians in the 1990s, just 20 people applied. Borrowing from Colombia's then-favourite TV show, Baywatch, it rechristened the job as Bikewatch, and more than 1,500 resumes immediately poured in.

Most often, the guardians' job is to dispense first aid, since in a wheeled crowd of this size, accidents do occur, especially as La Septima narrows into the city centre and the historic La Candelaria district, turning Ciclovia into a kilometres-long peloton.

Through La Candelaria, Ciclovia acts as a sightseeing tour of Bogota’s best, passing the city's famed Gold Museum, which contains the world's largest collection of pre-Hispanic gold, and entering the European-style grandeur of central Plaza de Bolivar, which is ringed by grand edifices and crowded with pigeons.

From Plaza de Bolivar, Ciclovia burrows through Bogota's poorer southern suburbs. Immediately south of the plaza is the district of La Cruces, which has all the beauty of La Candelaria but which, for most of the week, is considered unsafe for visitors. On Sunday, however, La Cruces is crowded with families, cyclists and pedestrians, as Ciclovia tames the city. There are no dangers here beyond a bike accident. Look around and you may just see the next Nairo Quintana wheeling through the streets.