Michael Ellis will take up the post of attorney general while Suella Braverman takes maternity leave, Downing Street has said.
The government announced last month that legislation would be introduced to change the “clearly outdated” rules and allow her to take the leave.
Ms Braverman will be designated Minister on Leave (Attorney General) during her six months of maternity leave.
Mr Ellis has been temporarily promoted from solicitor general, with Lucy Frazer in turn replacing him.
“The prime minister gives the attorney general his very best wishes for her maternity leave and looks forward to welcoming her back in the autumn,” a Downing Street statement said.
The announcement comes after the Ministerial and Other Maternity Allowances Act was passed by parliament on Monday.
Without the legislation, Ms Braverman would have had to quit in order to take time off to spend with her baby.
However, the government is facing potential legal action for not widening the offer to all MPs.
Speaking in the Commons last month as the legislation was making its way through parliament, Labour MP Stella Creasy said passing the bill could “send an incredibly dangerous” message to employers by creating a “two-tier system”.
Ms Creasy said in an interview with the BBC that she was “prepared to go to court over this because it is a form of direct discrimination”.