By all accounts, Thomas J. D'Alesandro III had had his fill of City Hall by 1971. He'd been mayor for a single but tumultuous term, marked by the 1968 riots, racial strife and strikes by city laborers, bus drivers, even symphony musicians.

"It's all over," he told reporters as he left office to resume his private law practice. "I'm all through."But three decades and four mayors later, D'Alesandro is back -- as an informal adviser to Mayor Martin O'Malley, who consults him on some of the stickiest City Hall issues and appointed him to serve as a Housing Authority commissioner, a volunteer post.

O'Malley has had prickly relations with one of his predecessors, William Donald Schaefer. But he and the 73-year-old man still known as "Young Tommy" seem to have forged a rare political friendship, one based on mutual respect rather than quid pro quos. This despite Schaefer's contention that the 39-year-old O'Malley doesn't listen to anyone older than 40.

"He's been a great source of advice and counsel, especially when stuff is hitting the fan," O'Malley said. "Everybody who tries to pour advice into your ear does it with some sort of bias or agenda. He's got no agenda, nothing to gain. He's just happy to contribute. He also has great political instincts."

For his part, D'Alesandro seems to relish his role as elder statesman and is content to play it behind the scenes. Let his kid sister -- Rep. Nancy Pelosi of California, the newly elected House minority leader -- be the high-profile politician in the family. If D'Alesandro, now retired, can help in a quiet way, he is glad to do it.

"A lot of times, you get the feeling that no matter what the administration is, constructive criticism is not welcome," D'Alesandro said. "They don't mind you shaking hands, but don't give them any advice. That's not the case with O'Malley."

They're an odd couple in many ways: the brash young man known for his Irish rock band, muscle shirts and occasional bursts of profanity, and the courtly grandfather of 10 who favors big-band music and wears a jacket and tie to Orioles games.

While O'Malley is a political maverick who publicly skewers fellow Democrats and considered taking on a Kennedy in September's gubernatorial primary, D'Alesandro, the son of a powerful machine politician, is a party loyalist who believes in hashing out differences behind closed doors.

In temperament, the outspoken and sometimes impatient O'Malley probably has more in common with D'Alesandro's late father, who was mayor from 1947 to 1959. Thomas D'Alesandro Jr. -- "Big Tommy" -- was scrappy and blunt, Baltimore's version of Richard J. Daley of Chicago. Once, when a reporter prefaced a question by saying his "desk" -- The Sun's city desk -- wanted to know something, Big Tommy put his ear to his desk and said, "My desk tells me to tell your desk to go [bleep] itself."

"His father, he'd kick ass from one end of the city to the other," recalled Dan Zaccagnini, who was a special assistant to Young Tommy.

Although more reserved than O'Malley, D'Alesandro is no wallflower. He is an engaging raconteur who, in the right company, spices up old-time Baltimore political tales with salty language. In an interview after leaving office, he described the experience of being mayor as being served plate after plate of poop -- except he didn't say poop.

"Tommy has a great personality, like O'Malley," said Kalman "Buzzy" Hettleman, an administrative assistant to Young Tommy. "Very outgoing, down-to-earth personality. Tommy never blew his fuse publicly the way O'Malley did. But he would in private. And Tommy, in a very good-natured way, could out-expletive anybody."

Many similarities

There are other similarities -- personal and political.

"They're both very gregarious," said Robert C. Embry Jr., who served as the younger D'Alesandro's housing commissioner. "They're both great performers. Both Roman Catholic. Both descended from an ethnic group that was kind of shut out. Both fathers were politicians."

(O'Malley's father has twice run unsuccessfully for Montgomery County state's attorney, and his grandfather was a ward leader on the north side of Pittsburgh.)

Both lawyers elected in their late 30s, D'Alesandro and O'Malley saw their families grow while in office. D'Alesandro's fifth child, Gregory, was born in 1968. O'Malley's fourth, John, arrived Oct. 4.

Both men surrounded themselves with young advisers and aides, giving their administrations an image of vigor and dynamism that in his day D'Alesandro called "razzmatazz."

'Can read each other'