RAMALLAH, West Bank — Palestinian Prime Minister Ahmed Qureia and his Cabinet ministers submitted their resignations Thursday as the Islamic militant group Hamas appeared to have captured a large majority of seats in the Palestinian elections — a shocking upset sure to throw Mideast peacemaking into turmoil.