The Prime Minister of the Democratic Socialist Republic of Sri Lanka is the head and most senior member of parliament in the cabinet of ministers. It is the second-most powerful position in Sri Lanka's executive branch behind the president, who is the constitutional chief executive. The Cabinet is collectively held accountable to parliament for their policies and actions. Dinesh Gunawardena has been prime minister since 22 July 2022, after Ranil Wickremesinghe was sworn in as the President. The president will appoint a member of parliament as prime minister, who in the president's opinion, "is most likely to command the confidence of Parliament". The prime minister holds office throughout the period during which the cabinet of ministers continues to function under the provisions of the constitution unless the prime minister resigns from the post or ceases to be a member of parliament. Under the Soulbury Constitution the post of Prime Minister was created in 1947 as the head of government in the Westminster system. In 1978, under the second amendment to the Republican Constitution of 1972 much of the powers of the premiership were transferred to the executive presidency as head of government and head of the cabinet of ministers in addition to being the head of state. As a result, the prime minister became a senior member cabinet of ministers and successor to the president. The prime minister would serve as the deputy to the president if both are from the same political party. On certain occasions, when the president is not from the majority party in parliament or a national government is formed, the prime minister would be appointed from a party different from the president's. In such a situation the prime minister would serve as the de facto head of government. In 2015, the nineteenth amendment restored a certain degree of powers to the premiership. The prime minister is the second in the order of precedence after the president and head of the cabinet of ministers.