Former deputy Lib Dem leader Simon Hughes, who earlier this year stated that marriage was “ordained by God” and should be reserved for heterosexual couples, has been appointed Minister of State at the Ministry of Justice.

The announcement was made by Downing Street on Wednesday following the resignation from government of Lord McNally who has been appointed Chair of the Youth Justice Board.

Speaking on ITV’s This Morning in February, he said: “I will be voting against the timetable motion for just that reason. I shall support the bill, because I think it was Edgar in King Lear who said ‘stand up for bastards’. I think we need to stand up for gay people and their civil rights, but I believe that we must seek to get maximum consensus and therefore a programme motion that restricts that would not be the right way forward.”

In September 2012, the MP told the Huffington Post that he would not serve in government as he liked being able to speak his mind to “any [Lib Dem] minister from Nick (Clegg) downwards”.

Lib Dem party rules means Mr Hughes’ appointment to government means requires a contest to select a new deputy leader.

He has formally stepped down.

In a statement on Wednesday, Mr Hughes said: “It is a privilege and a huge responsibility to be appointed to this important job in government. Issues of justice and civil liberties have been my passions since I was a teenager. Justice and civil liberties are also core issues for every Liberal Democrat in the country.

“Lord McNally will be a hard act to follow, but I will try and build on his significant achievements and wish him the very best in his important new role. I look forward to working in the Ministry of Justice and to contributing energetically to progressive and successful decisions and policies for the fairer and safer society which every Liberal Democrat wants to achieve.”

Deputy Prime Minister and Lib Dem leader Nick Clegg added: “I am delighted to welcome Simon to the Liberal Democrat government team. He has been a passionate voice for the party’s principles and values throughout the Liberal Democrats’ journey from party of opposition to party of government.

“Simon will now be able to use his talents inside the coalition, helping the Liberal Democrats to anchor the government in the centre ground and helping us to build a stronger economy and a fairer society, enabling everyone to get on in life.”