Gov. James E. McGreevey resigned Thursday, announcing that he had an affair with a man and that it had left him vulnerable to "false allegations and threats of disclosure."

"My truth is that I am a gay American," the married father of two said at a news conference at the State House here. "This, the 47th year of my life, is arguably too late to have this discussion. But . . . at a point in every person's life, one has to look deeply into the mirror of one's soul."

McGreevey's voice hitched several times but he retained his composure. He said that his affair had brought great pain to his wife, Dina Matos McGreevey, who stood by his side as he spoke. "I engaged in an adult consensual affair with another man," he said. "It was foolish . . . and for this, I ask forgiveness."

The first-term Democrat, who has faced questions about his political ethics recently, said his resignation would take effect Nov. 15. State Senate President Richard J. Codey (D) will become acting governor and serve out the remainder of McGreevey's term, which ends in early 2006. Had McGreevey resigned immediately, state law would have required a special election within two months.

Golan Cipel, McGreevey's former lover, served in the governor's administration and earned $110,000 a year as homeland security adviser, several New Jersey political sources said. But Cipel, a published poet and a native of Israel, resigned after it was discovered that he had exaggerated his credentials, and he has since moved from one politically connected business to another.

Cipel, 33, threatened this week to publicize his affair with McGreevey, said a former aide to the governor. The aide and others in Trenton said Cipel is expected to file a sexual-harassment lawsuit against McGreevey this week. Washington Post reporters' efforts to reach Cipel for comment were unsuccessful.

"New Jersey isn't the Bible Belt," said Cliff Zukin, a professor of public policy at Rutgers University. "The governor only told us he was gay because he knew something untenable was coming down the road."

McGreevey faces other political problems. In the past two months, federal prosecutors in Newark have indicted two men who are top fundraisers for him. McGreevey's name appears 83 times in the indictment of one of the men, and Cipel recently worked for the other fundraiser.

"Could McGreevey have survived outing himself? Probably," said Jon Shure, a top aide to a former Democratic governor. "But he had no political capital left in his bank."

Still, the governor's pained talk of his lifelong denial of his sexuality was riveting for gays who watched the televised news conference. "If you're a member of New Jersey's lesbian and gay community, you didn't watch the governor's speech today with political or legal eyes -- you watched it with personal eyes. We all know how difficult it is to come out as openly gay, whether to family or other loved ones," said Steven Goldstein, chairman of Garden State Equality, a gay advocacy group.

When he was elected governor in 2001, McGreevey seemed possessed of a golden touch. He was athletic and handsome, with a boyish face that shaved 10 years off his age. A product of a working-class family, he attended parochial schools and volunteered for many things. He would graduate from Columbia University and Georgetown Law School and later add a master's from Harvard.

He married, had a daughter and got divorced. After he lost his first race for governor against Republican Christine Todd Whitman in 1997, McGreevey met Dina Matos, a Catholic from Newark's Portuguese Catholic Ironbound neighborhood. They married and had a daughter.

It seemed perfect, but McGreevey spoke of another reality. "From my early days in school until the present day, I acknowledged some feelings, a certain sense that separated me from others," he said. "But because of my resolve . . . I forced what I thought was an acceptable reality onto myself, a reality which is layered . . . with all the, quote, 'good things.' "

In fact, rumors had long circulated about McGreevey's sexual identity. Political insiders debated whether he was gay, and many spoke of how the governor could be utterly engaging one moment and distant the next. "It always seemed there was a story behind his story," said David Rebovich, managing director of the Rider Institute for New Jersey Politics. "It seemed to close observers that Jim McGreevey was haunted by something."

Recently, New Jersey reporters had written about the governor's house-hunting trips with an aide. One radio host even quizzed McGreevey about his friendship with Cipel, asking if the governor had been a good friend of his.

"Very good friends," McGreevey replied.

"Remains a good friend?" the radio host inquired.

"Yes," McGreevey said.

McGreevey is the second governor to resign this year, following John G. Rowland (R-Conn.), who stepped down amid an ethics investigation.

The New Jersey governor is the latest in a series of public figures whose careers have been seriously damaged or destroyed by revelations of their homosexual activities.

Former representative Gerry E. Studds (D-Mass.) was the first member of Congress to acknowledge he was gay, in 1983. He was censured after a former page revealed he had had a sexual relationship with Studds 10 years earlier. Massachusetts voters returned him to office. Rep. Barney Frank (D-Mass.) was reprimanded by the House in 1990 after he acknowledged he had paid for sex with a male prostitute and hired him as a personal aide. Former representative Robert E. Bauman (R-Md.), who opposed gay rights legislation, was charged in the District in 1980 with soliciting sex from a 16-year-old boy. He was defeated later that year.

Even as McGreevey resigned, he faced the charge that his timing was politically calculated. Aides portrayed his decision not to leave office until mid-November as driven by the need for a smooth transition in this time of a terrorism alert. Republicans dismissed the explanation, saying the timing is purely political.

If McGreevey left before Sept. 13, it would trigger a special election. If he steps down afterward, the Democratic Senate president can serve out the governor's term.

"Regardless of the governor's personal issues, he can no longer effectively govern the state," said Brian Nelson, executive director of the New Jersey Republican State Committee, who threatened to sue to force a quick resignation.

That, in turn, would give the state's most powerful Democrat, Sen. Jon S. Corzine, time to consider whether he wants to run for governor. "The field is open to Corzine," Shure said. "It's clear that the Democratic strategists around the governor feel the party is better off leaving the selection until next year."

Staff writer Eric Pianin in Washington and researcher Richard Drezden in New York contributed to this report. Powell reported from New York.

Gov. James E. McGreevey resigns with wife, Dina Matos McGreevey, and father, Jack McGreevey, by his side.Gov. James E. McGreevey addresses a news conference with his wife, Dina Matos McGreevey, and his mother, Veronica McGreevey, standing nearby.