BAGHDAD — An American man who said he had been kidnapped nine months ago by Iraqi militants was handed over to United States officials in Baghdad on Saturday night in a bizarre and murky series of events that caught diplomats here by surprise.

Speaking at a news conference in Baghdad, the camouflage-clad American, identified as Rand Hultz, said he was a former soldier who had returned to Iraq as a civilian contractor before being kidnapped last June by a Shiite paramilitary group loyal to the anti-American Shiite cleric Moktada al-Sadr. He said he had been shuffled from house to house around Baghdad before his release on Saturday.

“It was explained to me that this is a gift to me, my family and the American people who opposed the war,” Mr. Hultz said in a stilted, sometimes halting deadpan during the news conference. “Without a doubt I and my family thank Saeed Moktada al-Sadr.”

At the news conference, Sadrist politicians called the American’s release a demonstration of the “humanitarian and moral standards of the Iraqi Islamic resistance” meant to cultivate good will after the American military’s withdrawal from Iraq.