Marvin Mandel, after 19 months in prison, walked out of a halfway house here today as a free man.

It was the final act in the drama that began six years ago when Mandel was indicted on political corruption charges. President Reagan commuted the prison term of the former Maryland governor on Dec. 3, cutting five months from Mandel's sentence. Reagan ordered him transferred immediately from a federal prison camp in Florida to the Baltimore halfway house where Mandel completed his last days as a federal prisoner.

"Just a few minutes ago my attorneys were singing to me, 'Free At Last,' " the smiling Mandel exclaimed as he swept into a press conference a few hours after his pre-dawn release. "It's a great feeling."

At about 3 a.m., Mandel was rousted out of bed at the halfway house by the glare of a flashlight shined in his eyes by prison officials. He got dressed and was given the executive clemency document signed by President Reagan -- his ticket to freedom.

The official release date ordered by Reagan is Dec. 20. Standard procedure at the halfway house is for prisoners to be freed on Friday if their release date falls during the weekend.

W. Dale Hess, Mandel's longtime friend and one of the five men convicted with him in 1977 on mail fraud and racketeering charges, was released from the halfway house at the same time. They left together and Hess dropped Mandel off at the Hyatt Regency Hotel near the harbor, where Mandel later had a private celebration breakfast with his wife Jeanne and attorneys Bruce Bereano and Arnold Weiner.

Then came the press conference at Weiner's office, where Mandel delivered a heavy dose of his old political sidestepping show, along with a touch of contrition. He spoke of the events that led to his conviction, and issued his customary denial of wrongdoing.

"I'm convinced that what I did, or didn't do . . . was not a crime," he said.

But something new was added this time. The 61-year-old Mandel acknowledged that he may have made some "mistakes" and shown "bad judgment."

"I'm sorry," he said. "I'm very sorry that it did bring . . . perhaps a cloud over the people of Maryland."

He has "no intention at the moment" of seeking political office, Mandel told the assembled reporters, adding: "But I'm not going to cut off my bridges behind me and make a flat statement that I wouldn't, because only a fool would do that."

The office he would find most attractive, Mandel said with a sly smile, is "the one I thought I could win."

Having completed his prison term, Mandel has won his right to vote again in Maryland and could run in 1982 for any office except governor. Gubernatorial candidates must have been registered voters in Maryland for at least five years preceeding the election, and Mandel lost his voting rights when he was convicted.

Mandel said that he has "been doing some writing," and "possibly" is working on a book-- one that would draw on memories of other government leaders and his own life, which he said "has been rather interesting, to say the least."

For the immediate future, Mandel said, he plans to remain at his new job with a construction and development company, and on Sunday to celebrate the Jewish holiday of Hanukkah with a small, family dinner.

"Nothing elaborate," Mandel explained as he left the press conference. "We'll go to services and thank the Lord that I'm back home."