Dominion status, raised to independence itself followed on 4 February 1948, with military treaties with Britain (the upper ranks of the armed forces were initially British) and British air and sea bases remaining intact. Senanayake became the first Prime Minister of Sri Lanka. In 1949, with the concurrence of the leaders of the Ceylon Tamils, the UNP government disenfranchised the Indian Tamil plantation workers.This was the price that Senanayake had to pay, to obtain the support of the Kandyan Sinhalese who felt threatened by the demographics of the tea estates, where the inclusion of the "Indian Tamils" would have meant electoral defeat for the Kandyan leaders. Senanayke died in 1952 after falling from a horse. He was succeeded by his son Dudley Senanayake, the minister of Agriculture. However, in 1953 - following a massive general strike or 'Hartal' by the Left parties against the UNP, Dudley Senanayake resigned. He was followed by John Kotelawala, a very senior politician and an uncle of Dudley. Kotelawala did not have the enormous personal prestige or the adroit political acumen of D. S. Senanayake . He brought to the fore, the issue of national languages that D. S. Senanayake had adroitly kept on the back burner. He antagonized the Tamils and the Sinhalese by stating conflicting policies with regard to the status of Sinhala and Tamil as official languages. He also antagonized the Buddhist lobby by attacking politically active Buddhist Monks who were Bandaranaike's supporters.
In 1956 the UNP was defeated at elections (being reduced to 8 seats in Parliament) by the Mahajana Eksath Peramuna, which included the Sri Lanka Freedom Party (SLFP) led by Solomon Bandaranaike and the Viplavakari Lanka Sama Samaja Party of Philip Gunawardena. Bandaranaike was a politician who had nursed the Sinhala nationalist lobby since the 1930s. He replaced English with Sinahala Only as the official language. He was the chief Sinhalese spokesmen who attempted to counter the communal politics unleashed by G. G. Ponnambalam. In 1957 British bases were removed and Sri Lanka officially became a non-aligned country. The Paddy Lands Act, the brainchild of Philip Gunawardena was passed, giving those working the land greater rights vis-a-vis absentee landlords.
Bandaraike entered into a pact with Chelvanayagam of the Tamil-based Tamil Arasu Kachchi to secure more rights for the Tamils, but this was opposed by G. G. Ponnambalam and by JR Jayawardene of the UNP. The latter organised a "March to Kandy" in protest. This triggered hostility from the Tamil minority which soon led to disturbances, culminating in serious riots in 1958.
Philip Gunawardena, while in government, continued to organize strikes in the Colombo port. He was removed from the government as the right-wing of the governing coalition grew into the ascendent. The right-wing forces also conspired against the government. This was the time when McCarthyism was rampant in the United States, and Mossadeq had also been assassinated in Iran. Bandaranaike was assassinated in September 1959. His successor Wijayananda Dahanayake, an ex-LSSP member from Galle, was unable to hold the government together, and elections in March 1960 brought the UNP under Dudley Senanayake back to office, but without a working parliamentary majority.
Fresh elections in July saw Bandaranaike's widow, Sirimavo Bandaranaike, lead the SLFP to power and become the world's first elected female head of government. Her government avoided further confrontations with the Tamils, but its socialist policies of nationalization led to a cut-off of United States aid and a growing economic crisis. After an attempted coup-d'etat by right-wing Army and Police officers who were mainly non-buddhists, aimed at bringing the UNP back to power, Bandaranaike nationalised the oil companies. This led to a boycott of the country by the oil cartels, which was broken with aid from the Kansas oil producers co-operative. In 1964 she formed a coalition government with the LSSP, a Trotskyist party with Dr N.M. Perera as Minister of Finance.
Dissatisfaction with the economic situation brought the UNP under Senanayake back to office in 1965, but this government fared no better, since the underlying cause of Sri Lanka's problems were the declining market, the exploding population resulting from advanced health services and social welfare. Its traditional commodity exports, tea, coffee and rubber could not match the costs of importing food and maintaining the welfare economy. In 1968 Bandaranaike formed a coalition, the United Front with the LSSP and the Communist Party of Sri Lanka, which swept the 1970 polls on a platform of socialism.