Rajapakse was a founding member of the United National Party in 1947 and was appointed to the Senate of Ceylon and became the leader of the house. He was soon after appointed by Prime Minister D. S. Senanayake as the first Minister of Justice. In 1948 he was appointed to the seven member flag committee that consisted S. W. R. D. Bandaranaike, J. R. Jayawardene, John Kotelawala, T. B. Jayah, G. G. Ponnambalam and S. Nadesan. He was knighted in the 1952 New Year Honours. He resigned as Minister of Justice in 1953, after Prime Minister Sir John Kotelawala requested his resignation from the cabinet and returned to his legal practice.
