The largest cemetery in the restive province of Diyala has more than 20,000 graves, some date back as far as 1600 A.D., and covers more than a mile and a half of land.

The cemetery also has something that few others in the world have: living residents.Over the past several years, about 25 families fled to the cemetery from poor villages in the province that had been taken over by insurgents.

The cemetery, which sits in the middle of the province’s capital, Baquba, was a safe haven, the resident said. Although there were dead people, there were no explosions or assassinations.Even though the United States has withdrawn all of its troops from Iraq, the residents have remained at the cemetery because the province is still one of the most violent in the country.

The families knocked over centuries-old gravestones, building mud huts over the ground where bodies had been buried. The gravestones that were not knocked over were used to make clotheslines, and others became hiding places for children playing the Iraqi version of “cops and robbers.”

“We were scared playing among the graves, but we got used to it,” said an 8-year-old boy named Mohamed who lives with his family at the cemetery. “We have no other place to live in, and nobody to take care of us.”When there are burials, the children often attend the ceremonies. Some beg for money, while others try to find out how the person died and report back to their friends about the death.

“The most difficult time for cemetery residents is the Islamic holiday of Eid and other Islamic holidays where people come to the cemetery to mourn and scream and cry,” said Akram Yasir, 40, who lives near the cemetery. “With people screaming and moaning for hours, it really scares children.”

Abu Adnan, 54, who lives with his family in the cemetery, said that he often had dreams about the dead bodies that his house rests on.

“I dream sometimes of dead spirits calling me to move my house,” said Mr. Adnan. “I can hear them say ‘Move away from our heads, you are too heavy.’ Sometimes I turn on the radio and listen to the reading of the Koran to make me feel relaxed and safe.”

Khalisa Mustafa, a housewife who lives in the cemetery, said that she feared nighttime because “the environment is so scary.”Ms. Mustafa, 35, added: “Poverty pushed us to live among the dead.”

Not surprisingly, there is no running water or sewage system in the cemetery. So, the residents have created several small channels that carry dirty water away from their homes.But the channels have expanded, washing away some gravestones.

“Most of these families represent the results of the sectarian conflict,” said Nasir Al-Shimary, a human-rights activist in Baquba. “If the government doesn’t seriously address the country’s problems, there will be more people living in cemeteries in the future.”