An unobtrusive side door halfway down the right wall of the nave in San Marco leads straight into the courtyard of the Palazzo Ducale (Doge's Palace). Today's visitors take a more roundabout route, but that door is a potent symbol of the entwinement of Church and state in the glory days of La Serenissima. If the basilica was the Venetian Republic's spiritual nerve centre, the Doge's Palace was its political and judicial hub. The present site was the seat of ducal power from the ninth century onwards, though most of what we see today dates from the mid 15th century. Devastating fires in 1574 and 1577 took their toll, but after much heated debate it was decided to restore rather than replace - an enlightened policy for the time.

The palace is the great Gothic building of the city, but is also curiously eastern in style, achieving a marvellous combination of lightness and strength. The ground floor was open to the public; the work of government went on above. This arrangement resulted in a curious reversal of the natural order. The building gets heavier as it rises: the first level has an open arcade of simple Gothic arches, the second a closed loggia of rich, ornate arcading. The top floor is a solid wall broken by a sequence of Gothic windows. Yet somehow it doesn't seem awkward.

The façade on the Piazzetta side was built in the 15th century as a continuation of the 14th-century waterfront façade. On the corner by the ponte di Paglia (Bridge of Straw) is an exquisite marble relief carving, the Drunkenness of Noah from the early 15th century, while on the Piazzetta corner is a statue of Adam and Eve from the late 14th century. The capitals of the pillars below date from the 14th to the 15th centuries, although many of them are 19th-century copies (some of the originals are on display inside the palace).

The Porta della Carta (Paper Gate - so called because this was where permits were checked), between the palace and the basilica, is a grand piece of florid Gothic architecture and sculpture (1438-42) by Bartolomeo and Giovanni Bon. The statue of Doge Francesco Foscari and the lion is a copy dating from 1885; French troops smashed the original when they occupied the city in 1797.

Behind the palace's fairy-tale exterior the complex machinery of empire whirred away with assembly-line efficiency. Anyone really interested in the inner workings of the Venetian state should take the 90-minute Itinerari Segreti tour. This takes you into those parts of the palace that the official route does not touch: the cramped wooden administrative offices; the stark chambers of the Cancelleria Segreta, where all official documents were written up in triplicate by a team of 24 clerks; the chamber of the three heads of the Council of Ten, connected by a secret door in the wooden panelling to the Sala del Consiglio dei Dieci, and the torture chambers beyond. The tour ends up in the leads - the sweltering prison cells beneath the roof from which Casanova staged his famous escape (probably by bribing the guard, though his own account was far more action hero) - and among the extraordinary beams and rafters above the Sala del Maggior Consiglio.

Following reorganisation, the main visit - for which an audio guide is recommended - now begins at the Porta del Frumento on the lagoon side of the palace. The Museo dell'Opera, just to the left of the ticket barrier, has the best of the 14th-century capitals from the external loggia; the ones you see outside are mostly copies.

In the main courtyard stands the Arco dei Foscari - another fine late-Gothic work, commissioned by Doge Francesco Foscari in 1438, when Venice was at the height of its territorial influence. It was built by Antonio Bregno and Antonio Rizzo. Rizzo also sculpted the figures of Adam and Eve (these too are copies; the originals are in the first-floor liagò), which earned him gushing accolades and led to his appointment as official architect in 1483, after one of those disastrous fires. Rizzo had time to oversee the building of the overblown Scala dei Giganti (where doges were crowned) and some of the interior before he was found to have embezzled 12,000 ducats; he promptly fled, and died soon after.

The official route now leads up the ornate Scala d'Oro staircase by Jacopo Sansovino, with stuccoes by Vittoria outlined in 24-carat gold leaf.

First floor: Doge's apartmentsThe doge's private life was entirely at the service of La Serenissima and even his bedroom had to keep up the PR effort. These rooms are occasionally closed or used for temporary exhibitions; when open, the Sala delle Mappe (also known as the Sala dello Scudo) merits scrutiny. Here, in a series of 16th-century maps, is the known world as it radiated from Venice. Just to the right of the entrance is a detailed map of the New World with Bofton (Boston) and Isola Longa (Long Island) clearly marked. Further on, seek out Titian's well-hidden fresco of St Christopher (above a doorway giving on to a staircase): it took the artist a mere three days to complete.

Second floor: State rooms This grandiose series of halls provided steady work for all the great 16th-century Venetian artists. Titian, Tintoretto, Veronese, Palma il Vecchio and Jacopo Bassano all left their mark, though the sheer acreage that had to be covered, and the subjects of the canvases - either allegories or documentary records of the city's pomp and glory - did not always spur them to artistic heights.

The Sala delle Quattro Porte was where the Collegio - the inner cabinet of the Republic - met before the 1574 fire. After substantial renovation it became an ambassadorial waiting room, where humble envoys could gaze enviously at Andrea Vicentino's portrayal of the magnificent reception given to the young King Henry III of France in 1574. The Anticollegio, restored in part by Palladio, has a spectacular gilded stucco ceiling, four Tintorettos and Veronese's blowsy Rape of Europa.

Beyond here is the Sala del Collegio, where the inner cabinet convened. The propaganda paintings on the ceiling are by Veronese; note the equal scale of the civic and divine players, and the way both Justice and Peace are mere handmaidens to Venice herself. But for real hubris, stroll into the Sala del Senato, where Tintoretto's ceiling centrepiece shows The Triumph of Venice. Here the Senate debated questions of foreign policy, war and commerce, and heard the reports of Venetian ambassadors. Beyond again are the Sala del Consiglio dei Dieci and the Sala della Bussola, where the arcane body set up to act as a check on the doge considered matters of national security. In the former, note Veronese's ceiling panel, Juno Offering Gifts to Venice. By the time this was painted in 1553, the classical gods had started to replace St Mark in Venice's self-aggrandising pantheon. The itinerary continues through an armoury.

First floor: State roomsThe Sala dei Censori leads down to a liagò (covered, L-shaped loggia), which gives on to the Sala della Quarantia Civil Vecchia (the civil court) and the Sala del Guariento. The latter's faded 14th-century fresco of The Coronation of the Virgin by Guariento (for centuries hidden behind Tintoretto's Paradiso in the Sala del Maggior Consiglio) looks strangely innocent amid all this worldly propaganda. The shorter arm of the liagò has the originals of Antonio Rizzo's stylised marble sculptures of Adam and Eve from the Arco dei Foscari.

Next comes the Sala del Maggior Consiglio - the largest room in the palace. This was in effect the Republic's lower house, though this council of noblemen had fairly limited powers. Before the fire of 1577 the hall had been decorated with paintings by Bellini, Titian, Carpaccio and Veronese. When these works went up in smoke, they were replaced by less exalted ones, with one or two exceptions. Tintoretto's Paradise, on the far wall, sketched out by the 70-year-old artist but completed after his death in 1594 by his son Domenico, is liable to induce vertigo, as much for its theological complexity as its huge scale. In the ceiling panels are works by Veronese and Palma il Giovane; note too the frieze of ducal portraits carried out by Domenico Tintoretto and assistants; the black veil marks where Marin Falier's face would have appeared had he not unwisely conspired against the state in 1356.

On the left side of the hall, a balcony gives a fine view over the southern side of the lagoon. A door leads from the back of the hall into the Sala della Quarantia Civil Nuova and the large Sala dello Scrutinio, where the votes of the maggior consiglio were counted; the latter is flanked by vast paintings of victorious naval battles, including a dramatic Conquest of Zara by Jacopo Tintoretto and Battle of Lepanto by Andrea Vicentino.

Criminal courts & prigioniBacktracking through the Sala del Maggior Consiglio, a small door on the left leads past the Scala dei Censori to the Sala della Quarantia Criminale - the criminal court. The room next door retains some of the original red and gold leather wall coverings. Beyond this is a small room that has been arranged as a gallery, with Flemish paintings from Cardinal Grimani's collection.

The route now leads over the Bridge of Sighs to the Prigioni Nuove, where petty criminals were kept. Lifers were sent down to the waterlogged pozzi (wells) in the basement of the palazzo itself. By the 19th century most visitors were falling for the tour guide legend that, once over the Bridge of Sighs, prisoners would 'descend into the dungeon which none entered and hoped to see the sun again,' as Mark Twain put it. But when this new prison wing was built in 1589, it was acclaimed as a paragon of comfort; in 1608 the English traveller Thomas Coryat remarked, 'I think there is not a fairer prison in all Christendom.'

Some of the cells have their number and capacity painted over the door; one has a trompe l'œil window, drawn in charcoal by a bored inmate. On the lowest level is a small exercise yard, where an unofficial tavern used to operate. Up the stairs beyond is a display of Venetian ceramics found during excavations, and more cells, one with cartoons and caricatures left by 19th-century internees. Back across the Bridge of Sighs, the tour ends on the lower floor in the Avogaria - the offices of the clerks of court. Next to this a bookshop has been set up, with a good selection of works on Venice.