The Prime Minister of the United Kingdom is appointed by the Queen, with agreement from the House of Commons (the elected members of Parliament). This is normally a mere formality and the leader of the party with the most seats generally gets appointed.