RAMALLAH, West Bank — Declaring that a “black page in history has been turned forever,” President Mahmoud Abbas of the Palestinian Authority swore in a new government on Monday intended to reunite the West Bank and Gaza Strip after seven years of harsh political and social division.

“Today we restore our national unity,” Mr. Abbas said in a speech after the new ministers took their oaths at his headquarters here. “We are all loyal to Palestine. We want to keep its banner hoisted high.”

The ceremony came six weeks after the Palestine Liberation Organization — dominated by Mr. Abbas’s Fatah faction — and the militant Hamas movement that has ruled Gaza since 2007 signed a pact paving the way for the new government. But the triumphant moment was marred by complaints from Hamas until the ceremony started over the government’s composition. The dispute illustrated the delicate task Mr. Abbas has in balancing internal politics and international diplomacy as he tries to maintain support even though Hamas is deemed a terrorist organization by the United States, Europe and much of the West and has refused to recognize Israel or renounce violence.

The Palestinians are also bracing for punitive sanctions by Israel, which on Monday announced that it would hold the new government responsible for attacks from the West Bank or Gaza, and would work “in the international arena” to block Hamas’s participation in the elections the new government is supposed to hold after six months.