The controversial proposals were first made last year
Inquests into some deaths could be held in secret in future after Parliament approved the controversial proposal.
It went through the Commons on Thursday after a series of concessions led to Tory peers dropping their opposition in the House of Lords on Wednesday.
The concessions include giving the lord chief justice the power to veto any requests for private inquests and also the power to decide who the judge is.
Ministers say secrecy may be needed in some cases for national security.
They want the option of a secret inquest when evidence obtained by intelligence gathering is likely to play a prominent role in the inquest.
But many MPs remain worried that holding some inquests in private rather than in public and in front of a jury gives the government too much power.
The measure, contained in the Coroners and Justice Bill, was formally approved by MPs on Thursday - the last day of the current parliamentary session - and will now go for Royal Assent.
The Conservatives abstained in a key vote on the bill in the Lords on Wednesday, meaning that a proposal for a public inquest to be held at the same time as a secret one was defeated.
And in final discussions over the bill in the Commons, the Tories failed in a last-minute effort to insert an additional legal safeguard.
A Tory amendment which would have required the lord chief justice to formally suspend an existing public inquest before agreeing to a private one instead was defeated by 57 votes.
Justice Secretary Jack Straw said this was unnecessary since Labour had already conceded that the lord chief justice would have an "effective veto" on beginning an inquest behind closed doors.
The secret inquest plan was dropped amid opposition last year but was resurrected in a different form as part of the Coroners and Justice Bill.
Ministers insist secret inquests will only happen in a "tiny number" of cases and that, in these cases, both the public interest and the interests of the families concerned will be protected.
Shadow justice secretary Dominic Grieve said he was "not happy" with the bill as it stood but believed critics had won a "substantial concession" over the authority given to the lord chief justice.
"It effectively gives the most senior judge in the country a veto not just over the appointment of the judge but over whether this process takes place," he said.
The Lib Dems said they were unconvinced by the concessions and argued the government would still be able to set an inquest's terms of reference while restricting who can attend and what information was published.
"It will affect those really sensitive cases, where for example police shoot somebody dead or somebody dies in very strange circumstances in prison," Lib Dem peer Baroness Miller said.
"These are the very cases that society as a whole and the families need to have confidence that actually the process has not gone horribly wrong."
And some Labour MPs have warned of problems in the new legislation.
"My main concern is that you could end up in limbo in that, on one hand, you have got the Lord Chancellor saying 'we want to have a secret inquest' and, on the other hand, the Lord Chief Justice saying you can't have a judge for it'," said Andrew Dismore.