Just after sunrise, the detainees began lining up inside the trash-strewn compound where they had spent the night -- their last night -- at this infamous prison west of Baghdad.

Many clutched elaborately woven bags made of the plastic packages of ready-to-eat meals. Some called out farewells to relatives and friends who would remain behind. Military police officers joked with the detainees and shook their hands. One MP gently warned, "I don't want to see you again, brother."

Finally, they walked out of the barbed wire enclosure, dumping weathered blankets and orange-and-rose-colored prison jumpsuits in separate piles and accepting $25 in cash intended to help them get back on their feet. Then they waited for the buses that would take them away from a prison that has become a dark shadow over the U.S.-led occupation of Iraq.

Before June 30, when occupation authorities are to transfer limited sovereignty to an interim Iraqi government, the U.S. military plans to drastically cut the number of prisoners at Abu Ghraib, where U.S. soldiers beat and humiliated detainees last year. The prison will remain in operation, primarily as a processing center and short-term security facility for people serving less than six months, and U.S. commanders plan to reduce the prison's population to between 1,500 and 2,000, down from as many as 7,000.

On Monday, about 400 prisoners were set free -- more than half of a planned two-day total of 640 releases, military officials said.

With new regulations in place and new soldiers on guard, many of the detainees said Abu Ghraib was not the same prison it was when reports of abuse by U.S. guards surfaced more than a month ago. Certainly, they said, it bore no resemblance to the institution where thousands of Iraqis were tortured and executed by former president Saddam Hussein's security forces.

"The Army is good now," said Satr Sim Mohammad, 23, who wore a black fez with red stitching. Asked why he had spent time at Abu Ghraib, Mohammad smiled and shook his head. "I don't know," he said. "I have a small problem."

As evidenced at the prison during the past two days, detainees and soldiers share something of a kinship, a sense of shared experience conveyed in a crude message on one soldier's T-shirt: "Don't piss me off. I spent time in an Iraqi prison." And it had been a long night for detainees and soldiers alike.

Iraqis who were scheduled to leave Monday had taunted those who were not getting out. When a fight broke out among the detainees who were not going to be released, the others crowded against a fence to watch. A military police officer fired a rubber bullet to scatter the fighters.

Spec. Elizabeth Nierman, 19, strode to the compound of detainees who were to be released. "You want to go home?" she asked. "Get back. Go away."

"Ali," she pleaded with an English-speaking detainee, "please tell these people to back up, to go away."

As a female military police officer, Nierman has not had an easy time in the compounds. Shortly after she arrived in February, she said, she had a piece of brick thrown at her, splitting open her lip. About a week ago, someone hurled a container of urine at her.

Spec. Anthony Marando, 20, of the 391st Military Police Battalion, said detainees were especially excited the night before they were released. But many, he said, were also wistful about relatives left behind.

"They like to talk," he said, gesturing to the compounds where chatter passed back and forth. "There's a lot of passing of notes. Everybody wants to say goodbye. There are people here who have 25 other members of their family here."

In the evening, Marando took a detainee across the pocked, dirt road to the medical compound to see his father. Father and son kissed each other on the cheeks and walked over to benches typically reserved for military police. They sat and talked and embraced each other.

Detainees who are to be released are normally kept away from other prisoners. But with so many scheduled to be released Monday and Tuesday, they were moved instead to Camp Ganci, an empty tent compound in the Abu Ghraib complex that other detainees recently vacated for a newer tent site.

Prison commanders plan to eventually clear the area and put up a new area solely for detainees being released. Instead of barbed wire, it will be surrounded by a chain-link fence.

"I can't wait to bulldoze this place," said Col. David Quantock, commander of the 16th Military Police Brigade.

On Monday, the first five buses carrying detainees rolled out of the prison around 8 a.m., guided by the 1st Infantry Division, which would take the prisoners near the areas where they were detained. A second load of buses left more than four hours later, their 1st Cavalry Division convoys delayed by another mission.

Outside the prison, friends and relatives waited in the dry, unrelenting heat for the detainees.

Kadhim Mohammed, 40, a trader, tried to catch a glimpse of his brother, who Mohammed said was arrested May 12 for carrying a light weapon.

"He told me that it is clear that the U.S. soldiers tried to be nice through their way of treatment," he said.

Others expressed outrage about what happened here, a continued reflection of just how deeply the Abu Ghraib abuse scandal has affected a populace that the occupation authority is still battling to win over in the days leading up to the handover.

"They claim they know humanity, but they don't," Jaber Mansour, 60, a farmer from Diyala, said as he hovered in a crowd outside the prison, where three of his relatives are being detained.

"I used to believe Bush at first when he said he'll make us get rid of the terrible days we went through under Saddam," said Nidhal Sultani, 44, a merchant. "What we face now is worse. I don't trust him, and I'll not anymore."

Special correspondent Bassam Sebti contributed to this report.

One of about 400 Iraqis released from the scandal-plagued Abu Ghraib prison leans out the window of a bus to embrace his waiting son. An Iraqi is embraced by relatives and friends after stepping off a bus from Abu Ghraib prison west of Baghdad. Some of those freed were saddened at leaving detained family members behind.Iraqis wave to those remaining in Abu Ghraib, which many said has improved since abuses became public.