Tram 28, as it clangs up and down Lisbon’s steep hills and circles around its castle, connects atmospheric old neighborhoods and grand plazas. It connects the centuries, too, ages from the Phoenicians and Moors through the Portugal’s Age of Discovery into 21st century. Along its route are traditional cafes and pastelarias, fado clubs and one of the city’s newest museums. Ghosts of poets and kings, saints and fadistas linger at its stops.

Also on Tram 28’s route are some of the city’s most scenic overlooks, belvederes called miradouros that look out across the red rooftops of Lisbon’s oldest neighborhoods to the broad Tagus estuary. There modern ships remind us that from this river sailed the intrepid 15th-century explorers who opened Europe to the whole world. The tram’s route is at once scenic, historic and the best way to tour the heart of old Lisbon.

Begin by buying a day transit pass for about $6.50; with it you can hop on and off trams and buses at will. Tram 28 begins its route at Praça Martim Moniz, a short walk from the main Rossio plaza. Although it’s right underneath the very traditional old Mouraria neighborhood, Praça Martim Moniz itself is the Lisbon’s most diverse, with shops of all ethnicities and faces of all colors, a reminder that Portugal’s colonial empire included Africa, Asia, South America and the Indian subcontinent.

You’ll spot the tram stop at the far side. While some other lines use modern versions, line 28 retains the creaky old yellow trams with polished wood interiors and jangly little bells that clear its tracks of pedestrians and vehicles. The sight and sound of these are as much a part of Lisbon tradition as a quick bica (espresso) or the melancholic chords of fado.

The tram leaves with a jolt, and after a couple of stops begins the steep climb that takes it to Largo da Graça. Alight here, and follow the crenelated wall alongside the white church to a shady miradouro with a sweeping view across the irregular tangle of red roofs, with the profile of Sao Jorge castle to the left. Before rejoining Tram 28, look for the blue-tiled façade of Pastelaria Estrela da Graça at 98 Largo da Graça, a neighborhood favorite sweet custard tarts and pastries baked right there. Cafes like these are good places for a visitor to feel more a part of Lisbon and less like a tourist.

The tram heads downhill along Voz do Operário, stopping within sight of Sao Vicente de Fora, a 16th-century church and monastery with azulejos in the cloister. These characteristic blue tiles are a legacy of Iberia’s long occupation by Islamic Moors, and you’ll see them adorning facades and interiors, especially of churches, all over Portugal.

Sao Vicente de Fora’s main interest, however is the monks’ refectory, which is now a pantheon of the Bragancas, Portugal’s last royal family. Here are tombs of kings and queens from Dom Joao IV, who died in 1656, to Dom Carlos, assassinated in 1908.

Tram tracks twist and turn through narrow streets until they emerge at Portas do Sol, a long terrace with a statue of St. Vincent, and views of his church with the river far below. Stairs lead down into the Alfama, and descending them will almost certainly lead to getting lost – not a bad thing, and the best way to savor Lisbon’s oldest quarter. Romans lived here, and after them the Visigoths. Streets are a Moorish tangle, designed after Kasbahs of North Africa to confound invaders, who would certainly become lost in the maze before reaching the castle above. Narrow streets also kept out scorching midday sun and today hold gentrification somewhat at bay in this working-class neighborhood.

More azulejos decorate Largo Santa Luzia, one of Lisbon’s loveliest miradouros, where Tagus and Alfama views are framed by an arbor. Just below, red umbrellas of Restaurante Miradouro Santa Luzia invite a stop before walking up Travesa de Sta Luzia, just uphill from the miradouro. At the top of Largo do Contador Mor turn right then left, following castle walls though an arched gate and into Castelo de Sao Jorge.

Phoenicians, Romans, Visigoths and Moors in succession occupied and fortified this commanding position above the city and in its vaulted interior, multi-media Olissiponia explains the historic details. Its walls, punctuated by ten square towers, surround the old Santa Cruz neighborhood, worth wandering through. One lodging lies within the walls, Solar Do Castelo, a luxury boutique hotel in an 18th-century building where the kitchens of the Alcáçovas Palace once stood.

Return to the tram line and get off just below the huge cathedral, the Se, built by Portugal’s first king after he ousted the Moors in 1147. St. Anthony (who was born across the street) was baptized here in 1195. Although its interior shows less of the gold that flowed into Lisbon from its New World colonies than many other churches do, it contains one of the most fascinating glimpses into the city’s many layers — literally — of history. In what was once the medieval cloister garden, a deep pit reveals levels dating back to the Iron Age. A Roman street lined by shops breaks into stairs as Alfama streets still do, a Moorish courtyard is surrounded by painted walls, and parts of Medieval buildings over which the cathedral was built are again visible.

If you return to this stop in the evening and follow Cruzes da Se to the right, you can hear authentic fadistas at Clube de Fado. Although not a tiny and intimate fado bar, and with its share of out-of-towners mixing with local fans, it’s not a tourist folklorico show either, and features both veteran and rising young fadistas.

Reboard Tram 28 into the heart of the Baixa. Here the streets flatten out and become an orderly grid, created when the neighborhood was rebuilt after a devastating earthquake in 1755. Watch to the left and get off when you see a monumental arch at the end of the street. This is Rua Augusta, where you’ll find a mixture of traditional shops selling everyday items like buttons, and smart shops selling bijou and fashionable shoes. Toward the arch, the fascinating new Museu do Design e da Moda displays the most iconic works of leading 20th-century designers: Charles Eames and Philippe Starck furniture, Christian Dior’s New Look fashions among them.

Beyond the arch, wide-open Praça do Comércio opens to the river on the far side, its other three bordered by stately arcades. The grandiose effect is a bit startling after the Alfama’s narrow spaces. Hidden under the arcades is the Sala Ogival de Lisboa, where ViniPortugal offers tastings of wines from various regions. An Enocard, about $2, allows tasting of two or three wines.

Tram 28 has not finished its journey around Lisbon, and continues on to connect more of the city’s most interesting sights – churches resplendent in New World gold, miradouros, romantic ruins, a grand basilica, one of Portugal’s finest contemporary restaurants, even an atmospheric English cemetery. But that’s for another day.

Best to now join the ghost of Portugal’s favorite poet, Fernando Pessoa at his favorite haunt beneath Praça do Comércio’s arcade. Café Martinho da Arcada is one of Lisbon’s oldest, founded in 1782, and looks about the same as it did when Pessoa wrote there and sipped absinthe with his literati friends.

While locals argue fiercely about who makes the best pastel de nata, the local pastry, this café is always one of the contenders. In the adjoining restaurant, the seafood is impeccably fresh, if a bit pricey. Few dishes are more traditionally Lisbon than their sadinhas assadas – perfectly grilled fresh sardines, served with a glass of chilled vinho verde. A perfect finish to a day touring Lisbon by vintage tram.