"Hoppa! Jump!" commands a voice from the rocks behind me. Barefoot on sun-baked cliffs, I launch myself into the icy clear water.

I gasp instinctively, but forget the cold on surfacing. Treading water in this quiet stretch of Lake Mälaren, not far from the centre of Stockholm, ducks paddle past me and a tiny wagtail, the size of a baby's fist, plays tag with waves I've made against the rocks. The lake is so clear you can see the crisscrossing roots of the water lilies. Yet a highway hums nearby.

The smooth, sloping cliffs of Fredhällsbadet are tucked away on the south-western tip of Kungsholmen, one of the 14 islands that make up Stockholm. "The most romantic bath in the city," pronounces Henrik, the bossy sunbather who encouraged my first city dip. Hauling myself from the water, I find him near the top of the cliffs, ashing cigarettes tidily into their packet and working on his suntan. On a scorching weekend this area bustles with young locals sharing beers and dive-bombing, but Henrik likes it best on warm, magical summer weekdays like today.

"Walk the coast and swim when you get hot, it's the best way to see the city," says Henrik, pointing a languid arm eastward towards a popular beach underneath Västerbron, the stylishly arched Western Bridge.

Beginning my walk I jump from the rocks surrounding a wooden jetty and later slide down a steep incline to paddle and swim in a little bay sheltered by trees. Winding stone staircases appear from nowhere, overgrown with vines and wild pink roses and, further east, a boardwalk materialises as the drone of Essingeleden motorway muddles with birdsong. The road juts right out of the rocks above my head, but somehow this only adds to the magic.

Thanks to stringent environmental laws, the waters of Lake Mälaren have been clean enough to fish and swim in since 1971. The islands of Stockholm are scattered where the lake meets the Baltic, but the lake is cleaner than the sea so urban swimmers are best to stick to the western edges of the city.

Just as I've dried off from my last rocky dip and am beginning to feel hot again, a sandy cove called Smedsuddsbadet appears around the corner, as Henrik promised, on the Kungsholmen side of the Western Bridge. This family-friendly beach has been open to the public since 1973 and becomes packed on sunny days. It doesn't have the wild majesty of Fredhäll, but it's cute. It's set in a bay with buoys marking it off from deeper water; children make sandcastles and chase ducks while teenagers lounge on a wooden dock. There are changing rooms and just beyond the sand, on the other side of a stubby finger of land, you can stop in the Kafé Kajak to dry off and buy an ice cream or fika (coffee with something sweet, usually a cinnamon bun). The café patio looks out at the Western Bridge – its swooping steel arches connecting the island of Kungsholmen to Södermalm via the smaller island of Långholmen.

The bridge was built in 1935 and stretches 602 metres, 340 of which pounce over the water like a giant bird skipping from island to island. Through its steel arches you can see the bell tower of City Hall, where the Nobel prize banquet is held, and beyond on to the terracotta facades of Gamla Stan, Stockholm's Old Town.

One of Stockholm's beaches. Photograph: Alamy

In the 13th century, these waters were crowded with pirates, trading boats and warships squeezing through the narrow passage where the freshwater of Lake Mälaren merges with the Baltic Sea. The city grew from a fortress built on the island by a Swedish statesman named Birger Jarl. Sweden controlled a key trade route and the surrounding area soon expanded into a city.

Now canoes slide among sailing boats, seagulls and the lolloping heads of swimmers.

Most of the year Stockholm is enclosed by blue ice and moody skies, so when the sun comes out this city exhales, uncurling from hibernation and heading for the water. The edges of the islands look like temples to sunshine during the summer months, scattered with locals, faces tilting towards the sky.

Långholmen island housed the largest prison in Sweden until 1975 and performed the country's last execution in 1910. It's 1.4km long and 400 metres wide at the fattest point and it offers swimming options all around its perimeter. Much of the prison has been demolished, but the remnants have been transformed into a hotel and hostel where guests sleep in "cells" and eat at colourfully chequered tables laid out in the vestiges of the "exercise yards". In a city that's notoriously pricey, Långholmen hostel is inexpensive. The prison museum is worth a look, as is the foxglove and poppy-strewn garden of Stora Henriksvik, a café serving homemade pastries and organic salads.

Eriksdalsbadet, the biggest swimming centre in Stockholm, is a shock to the system. My towel is sodden with lake water and my clothes are sticking to my body (in retrospect, a change of clothes would have been a good idea), but I get a rush of adrenaline at the smell of chlorine rising off the luminous aquamarine water. The vast outdoor pool looks alien with its concrete rims and straight lines, yet also strangely comforting. You don't have to avoid stray rocks or pre-plan your exit from the water. There are rules! And ladders! After a few laps, I collapse exhausted on the lawns covered in sunbathers and picnic tables. It's easy to lose track of time over Stockholm's long summer days, which can stretch to 18 hours of sunlight. It turns out I've been walking and swimming for five hours and my mind is beginning to turn from thoughts of water to thoughts of alcohol. This is a city walk, after all, and all good city walks end with a cocktail.

Anna Stothard in the Selma Spa's rooftop pool PR

The last stop of my tour is the most luxurious outdoor swimming location in Stockholm. Amble up through the middle of chic Södermalm and the bustling antique shops of Gamla Stan (or cheat and take the metro's green line west from Skanstull T-bana to Stockholm Central Station) towards a blissfully warm rooftop pool on the Clarion Hotel Sign in Norrmalm. The granite-and-glass building was designed by Swedish architect Gert Wingårdh and the inside is a homage to Nordic designers including Arne Jacobsen and Bruno Mathsson.

After a day of walking between rocky diving points, wooden piers, perfect beaches and giant pools, a quick shower and a swim in the hotel's Selma Spa heated pool, looking down on the railway and over the rooftops of Stockholm, is heaven.

A half-hour "aroma massage" and a well-deserved cocktail later, I'm swinging in the transparent egg-shaped chairs and looking out on the city from the Spa Bar. And I'm already making plans for more swimming tomorrow.

Anna Stothard's novel The Pink Hotel is out now in paperback (Alma Books, £7.99)

Essentials

SAS (flysas.com) flies from Heathrow to Stockholm from £148 return. The Grand Hotel, Södra Blasie-holmshamnen 8 (grandhotel.se) has doubles from £250 per night. Långholmen's Youth Hostel, Lång-holmsmuren 20 (langholmen.com) has dorm beds from £19 per night. At the Clarion Hotel Sign's Selma Spa (selmacityspa.se) a day package costs from £36. For more information, go to visitstockholm.com