In March 1947, he became Minister of Defence in the government of Ferenc Nagy, the leader of the Smallholders Party.
In the so-called "Blue Papers Election" on 31 August 1947, the Smallholders Party came in second surpassed by the Communists.
Dinnyés remained in office as Prime Minister until 1948, but merely served as an obedient puppet in the hands of the deputy premier, Communist Party boss Mátyás Rákosi.
While Dinnyés nominally headed the government, Rákosi laid the foundations of the communist dictatorship by nationalizing factories, banks and denominational schools.
In December 1948, the Communists used the emigration of the treasurer Miklós Nyárádi as an excuse to push out Dinnyés altogether and replace him with the fellow traveller István Dobi.