The US government is set to give 12 weeks paid parental leave to federal workers for the first time.

It will be available to around two million government personnel when they become mothers and fathers.

The move came as part of a defence bill passed by the House of Representatives, and is set to be approved by the Senate, and signed by Donald Trump within days.

A compromise between Democrats and Republicans in Congress combined the landmark parental leave provision alongside a $738 billion budget for the Pentagon.

The parental leave measure, which had been pushed by Democrats, will cost the US government an estimated $3.3 billion over the next five to 10 years.

Some on the liberal wing of the Democrat party continued to object to thedeal because of the size of the defence budget.

It will include a 3.1 per cent pay raise for military personnel, the largest in a decade

The compromise bill also included Mr Trump's demand for the new US Space Force as a sixth armed service.

That was reportedly key to getting paid parental leave included in the bill.

Democrats dropped a demand to block Mr Trump from transferring Pentagon money to fund border wall construction.