A new method to synthesise long-chain and functionalised methylphosphonate esters and the corresponding ionic liquids is reported. The synthesis comprises the formation of dialkyl methylphosphonate esters in a SN2 reaction followed by the use of these esters as alkylating agents to form the corresponding, new alkyl methylphosphonate ILs.