The medevac law will be repealed after a “secret deal” was struck between the government and key crossbencher, Tasmanian senator Jacqui Lambie.

The medical evacuation law, which was passed against the government’s will in the last sitting week of 2018, will be scrapped after Lambie joined One Nation senators and sided with the government in the Senate on Wednesday morning.

The government won the vote to repeal the law 37 votes to 35.

Lambie told the Senate she had made a “really hard decision” to support the legislation’s repeal, but had done so because the government had agreed to an “outcome” that would improve medical treatment for refugees held in offshore detention.

She has refused to disclose details of the proposal she put to government.

“I can’t let the boats start back up and I can’t let refugees die, whether it’s sinking into the ocean or waiting for a doctor, and I am voting to make sure that neither of these things happen,” Lambie said.

“We’ve worked to an outcome I believe we both want, which is an outcome that our borders are secure, the boats have stopped and sick people aren’t dying waiting for treatment. And as a result of that work … I am more than satisfied that the conditions are now in place to allow medevac to be repealed.”

Lambie said that while she did not believe medevac posed a national security threat, there were “real problems with the way it’s operating”.

“There are problems that sit at the centre of its operation. They cannot be amended away. The Labor party and the Greens might think everything is A-OK, but I’m not comfortable with it.”

A tearful Lambie said she was not being “coy or silly” by not revealing details of her proposal, saying it was a national security concern.

“I know that’s frustrating to people, and I get that. I don’t like holding things back like this. But when I say I can’t discuss it publicly due to national security concerns, I am being 100% honest to you.

“My hand is on my heart and I can stand here and say that I would be putting at risk Australia’s national security and national interest if I said anything else about this.”

She apologised to those who would be disappointed by her decision, but said she had considered what she could do to improve the system.

“Do I repeal the legislation or let it sit there? Not as perfect as the activists would have you believe, but not as terrible as the media loudmouths would have you believe either,” Lambie said.

“I did not accept that we could just go back to the way things used to be and I asked myself how we’d have to do things differently.”

Lambie has been in talks with the government since Monday after she presented a non-negotiable demand in order to secure her support to repeal the laws, which will now see powers of refusal for medical transfers fully restored to home affairs minister Peter Dutton.

While she has refused to disclose details of her demand, Lambie did not deny reports that she wanted the government to accept an offer from New Zealand to accept 150 refugees from Australia’s offshore detention network.

Labor and the Greens lambasted the deal, calling for details of the “secret deal” to be made public.

Labor’s home affairs spokeswoman Kristina Keneally said the parliament and the Australian people “have a right to know” what had been agreed to.

“What is the secret deal? There’s been a deal between the Morrison government and senator Lambie to drive a stake through the heart of medevac, and they’re keeping it secret from this parliament and from the Australian public,” Keneally told the Senate.

“Will it start the boats again? Will this secret deal undermine national security? Or will this secret deal follow through on a better result for the people who are held in regional processing centres in Manus and Nauru? We simply don’t know.”

The government leader in the Senate, Mathias Cormann, denied there had been a secret agreement struck with Lambie.

“Obviously, the Labor party doesn’t believe that anybody can be persuaded by a good argument,” Cormann said.

“The Labor party thinks that anything, whenever we are able to persuade anyone, the Labor party just assumes there must be some secret deal – there is no secret deal,” he said.

“There will be no change to our strong border protection arrangements, there will be no change to our strong national security arrangements, and there will be no change in the way we deal with the legacy caseload that Labor left behind when you were last in government.”

On Monday, Cormann told the ABC that the government would “not be horse trading on national security.”

Government sources were adamant that no deal had been done, saying Lambie had been given thorough, classified briefings about the government’s current approach to resettlement and it was on this basis that she had agreed to repeal the law.

The Greens senator Nick McKim said it was a “dark day” for the Senate.

“It’s a dark day for the majority of Australians who support the medevac legislation, it’s a dark day for the Senate, which is being asked to make a decision, shrouded in secrecy without all of the information in our hands,” McKim said.

“But do you know who this is the darkest day for? It’s the darkest day for those people who remain in Papua New Guinea and Nauru. That’s who this is the darkest day for because, under medevac, they could have confidence that if they had a medical condition so significant … that they needed to come to Australia for treatment, that is what would happen.”