Margaret Thatcher admitted she was sending young boys “to their deaths” as she descended into despondency over what to do about the border in Ireland during one of the darkest periods of her premiership, newly-declassified files in Dublin reveal.

During an “unusually tense” tête-à-tête with the then Irish taoiseach, Charlie Haughey, on the margins of a European council meeting in June 1988, Thatcher told him: “I do not know what to do about the border.”

Northern Ireland was trembling on the precipice of full-scale civil war after a terrifying and inextricably linked cycle of violence starting with the SAS killing of three unarmed IRA members in Gibraltar.

A loyalist grenade and gun attack on the IRA funerals at Milltown cemetery in Belfast claimed another three lives, and was followed days later by the killing of two British army corporals, dragged from their car, beaten and shot dead, after driving into the funeral procession of one of the Milltown victims.

“Those two corporals were among the worst things in my life,” Thatcher told the taoiseach. “The savagery was unbelievable.”

She said any move towards a united Ireland at the time would spark “the worst civil war in history”. “And it would spread to the mainland,” she added.

During an hour and a quarter of heated exchanges in the British delegation rooms at a trade centre in Hanover, Germany, she said she did not want Irish people in Britain.

“Your people come over to us. I wish they wouldn’t,” she said. “They come looking for housing and services. It’s the same in Northern Ireland. If there was a vote tomorrow they would vote to stay with us. They have better conditions in Northern Ireland and in England.”

Several times she pleaded with Haughey – who vigorously defended himself against suggestions he was soft on violence – for more pre-emptive intelligence against the IRA and better training for the Irish police, the Garda Síochána.

“If we don’t defeat the IRA, I don’t know what I’m going to do,” she said. “We can’t have the border open as it is now.

“In recent times my feelings have run far higher than ever before in my life. I am not a natural hater, they are using the border to carry on an effective campaign.”

Several times during the meeting, she came back to the border as central to her despair, saying the IRA were using it to move bombs over from the Republic or to flee from security forces in Northern Ireland.

“I can’t seal the border,” she said. “There is no way we can patrol the 500 miles … Everywhere there is an open border.”

Thatcher said the area contained the “biggest concentration of terrorists in the world” and “despite technological and other surveillance we lose them”.

“And so yes,” she added, “I must send more young boys over to their deaths. I ask myself, am I entitled to do it? There is a borderline there but it is not an effective border.”

During the extraordinary exchanges, just released into the National Archives in Dublin, Thatcher said she was “not winning the battle with the IRA”; that sending in troops had been “useless”; and she had “lost” unionists in Northern Ireland.

“So I have failed …,” she said. “I have to deal with guns, bombs, beating people to death with sticks and many other barbaric acts.”

She added: “I go berserk sometimes” when asked about the role of the police in Northern Ireland. Ultimately, she said, she had one objective: “That is to beat the IRA.”

Haughey said he was “sorry you are so despondent about things”, to which she fired back: “I would not be despondent if I got pre-emptive intelligence.”

The taoiseach insisted he held the “deepest personal conviction” against violence, which he blamed for “souring and disrupting and bedevilling” relations between Britain and Ireland.

“And I see those responsible for it as being a greater danger to the Irish state than to you,” he added.

Haughey told her she “must accept our total and complete commitment in this respect” and the British had to cease coming back with “counterproductive” suggestions which risked political backlash in Ireland.

“Things happen now – horrible things – which perhaps could or could not have been prevented,” he said.

“When they do, your people often blame us for lack of cooperation. I do not know if you are getting the best assessment of things on the ground.”