Militants battling on the rooftops of Gaza fired on the Palestinian government headquarters on Monday, forcing the ministers to flee the building. The unusually brazen factional fighting left seven Palestinians dead, including three killed in a hospital gunbattle.

Fighting between Fatah and Hamas forces resumed over the weekend, and the attacks have grown bolder. Prime Minister Ismail Haniyeh's home was shot at early Monday, and hours later a Hamas supporter was killed in a firefight near Beit Hanoun Hospital, witnesses said. The fighting shifted into the hospital, where three people with ties to Fatah were killed.

• Visit FOXNews.com's Mideast Center for more in-depth coverage.

On Sunday, two militants from the rival sides were dragged onto high-rise rooftops and thrown to their deaths.

Monday's fighting marred the first day of matriculation exams for thousands of high-school students in Gaza. With the students in mind, Haniyeh, of Hamas, and President Mahmoud Abbas of Fatah urged the sides to maintain calm. But their efforts to reach a cease-fire quickly broke down.

"This is shameful for our people," Abbas said during a trip to a school in the West Bank. "I call on everyone to stop this immediately, not only because of the examinations, but also for our people to live a normal life."

Sporadic gunfire could be heard throughout Gaza City during the day, intensifying several times.

Mohammed Madhoun, an aide to Haniyeh, said the government building was caught in the crossfire between rival Fatah and Hamas forces perched on the roofs of nearby buildings.

"The ministers are gone and the shooting is indiscriminate," he said.

Haniyeh's office wouldn't say whether he was home during the pre-dawn shooting there. But his wife, children and grandchildren were inside, his family said. It was the first time in a month of infighting that Haniyeh was an apparent target.

Daliya Naji, a 16-year-old student in Gaza City, said the fighting had kept her awake all night, and said she was having trouble concentrating.

"I am a good student, but I feel my brain is empty," she said ahead of her exams. "I can't think any more and I don't know what to do."

She said she hoped she would pass her exams in order to be accepted to a university in Egypt. "At least it will be my ticket out of Gaza," she said.

Testing went smoothly, though Hamas said the son of one of its members was kidnapped by Fatah forces as he returned home from school. There was no confirmation of the claim.

Hamas and Fatah have been locked in a violent power struggle since Hamas defeated Fatah in January 2006 legislative elections, ending four decades of Fatah rule.

Hamas brought Fatah into its government in March in an effort to quell the internal strife, but the fighting reignited in mid-May over an unresolved dispute over who controls the powerful security forces. The Palestinian Health Ministry said 67 people have been killed in the past month of fighting, most of them militants.

The deadly infighting has overlapped with new clashes between Israel and Palestinian militants who have been firing rockets at southern Israeli communities bordering Gaza.

Early Monday, Palestinian militants fired five rockets into southern Israel, the army said. There were no injuries.

On Sunday, Israeli political and military leaders pledged to keep up the pressure on Gaza after Palestinian militants infiltrated Israel a day earlier in a failed attempt to capture a soldier.

Complete coverage is available in FOXNews.com's Mideast Center.