The Department of Justice will operate beyond May after a cross-community vote in the Northern Ireland Assembly.
David Ford was appointed justice minister after a deal in 2010. At present, the minister can be removed by cross-community consensus.
Peter Robinson and Martin McGuinness sponsored legislation to continue operation of the department which has been approved by the Assembly.
First Minister Mr Robinson said: "It is hard to imagine a more democratic process, people have endorsed those proposals, the electorate is supreme."
He criticised the SDLP, which opposed the legislation, and "dissident" member for North Antrim Jim Allister and highlighted the mandate which his party had won.
"To say a free vote of the Assembly on the basis of cross-community support is undemocratic is, frankly, barking mad," he added.
Mr Ford's appointment as justice minister was a compromise to ensure justice powers could be transferred to Stormont from Westminster in April 2010.
The SDLP lost out on a second ministry, while the Alliance Party gained one.