BELFAST — Prime Minister Boris Johnson completed his awkward, somewhat hostile tour of the four nations in the United Kingdom on Wednesday with a visit to Northern Ireland.

He wasn’t booed, as he was by Welsh farmers and Scottish nationalists — because he was far away from demonstrators.

But his greeting was far from sunny. Johnson faces a real challenge keeping a restive four-nation kingdom allied as it hurtles toward a cliff-edge departure from Europe. He may rise or fall over how he handles questions about borders, the union and sovereignty.

As Johnson begins his premiership, vowing to leave the European Union, “do or die,” by the end of October, he is being greeted with blunt talk about what leaving without a withdrawal deal would entail.

He is also learning that his gung-ho Brexit-at-any-cost — which appealed to the elderly, white, male, well-to-do Conservative Party members who picked him as their leader — doesn’t translate as well outside England’s borders.

Johnson met Wednesday with the five fractious parties of Northern Ireland — a place so split that its gridlocked assembly has not convened since January 2017.

The party leaders were largely united on one thing: They warned Johnson that his threat to take Britain out of the E.U. without a deal, without a trade pact or a transition period, was folly, or worse.

“We are in a crisis, and Brexit is adding to the chaos,” said Naomi Long, the leader of the Alliance Party.

Mary Lou McDonald, the Sinn Fein president, said Johnson’s plan for a no-deal Brexit has increased the likelihood that the United Kingdom will splinter — by boosting the case for Irish reunification.

Speaking to the BBC on Wednesday morning, McDonald said: “Traditionally, the argument and the discourse has been between green and orange, between Irishness and Britishness. But Brexit changed that and added a new dimension, a critical dimension, which is: European or not? Inside the European Union or not?”

Northern Ireland is slated to leave the E.U. along with the rest of the United Kingdom. The Republic of Ireland to the south will remain a member of the E.U. One of the most vexing challenges of Brexit is what to do about the border between the two. Under what terms will milk, machine parts, beer, financial services, bacon and people move across?

Johnson has said he will not meet with European leaders until they agree to strike the Irish border “backstop,” or guarantee, from the withdrawal agreement they negotiated with his predecessor, Theresa May. 

The backstop seeks to ensure an open border by essentially tying Britain to E.U. rules and regulations in the case the two sides cannot agree to a trade deal that makes such a guarantee unnecessary.

After her meeting with Johnson, Sinn Fein’s McDonald said that if there was a hard Brexit, she would push for a vote for Northern Ireland to leave the United Kingdom. 

Nichola Mallon, a leader of the Social Democratic and Labour Party, said she had a “very blunt meeting” with Johnson and observed that he did not have a full grasp of the “complexities” of Northern Ireland. 

She said she told Johnson that he “must avoid a hard Brexit at all costs.” 

Mallon said she reminded the prime minister that he had responsibilities under the Good Friday Agreement, which ended 30 years of sectarian violence, and that he “must live up to them.”

Mallon said, “We pressed him time and time again and just got stock responses.”

On the other hand, Arlene Foster, the leader of Northern Ireland’s Democratic Unionist Party, said she and Johnson had a good talk.

Foster’s DUP has propped up the minority Conservative government in Westminster with a coalition partnership for the past three years. In exchange, the government under May and now Johnson is showering $1.5 billion on Northern Ireland.

Foster said Johnson promised to be “neutral on the administration of Northern Ireland but will never be neutral on the union.” She said an Irish referendum on unification would not receive Johnson’s endorsement.

Johnson did not make any public appearances during his four-hour visit to Belfast.

In a short statement to reporters on his arrival at Stormont House, the site of Britain’s Northern Ireland Office, he vowed to help the parties of Northern Ireland restart their stalled parliament.

The stalemate sits squarely on the shoulders of Irish politicians, but Johnson’s predecessor did little to alleviate it.

“It’s great to be here in Northern Ireland, and clearly the people of Northern Ireland have been without a government, without [the Northern Ireland Assembly], for two years and six months, so my prime focus this morning is to do everything I can to help that get up and running again,” Johnson told reporters, adding that he expected Brexit also to come up in talks.

Downing Street confirmed that he had planned no individual media interviews and would take no reporter questions during his visit, though a Sky correspondent cut in with a question about his dinner with the DUP.

As Johnson traveled north, Ireland’s central bank released new estimates, forecasting that a “disorderly Brexit” would cost the republic 34,000 jobs and reduce annual economic growth from 4.1 percent to 0.7 percent in 2020.

Damien McGenity, a leader of Northern Ireland’s Border Communities Against Brexit, stood outside the stalled parliament in Belfast to warn that a no-deal Brexit would be a job killer.

“This no-deal nonsense that the new prime minister is coming out with is just crazy,” he said.

“I cross the border seven or eight times a day. My wife works in the south. Her family lives on the other side of the border. It’s just us going about our daily life. And no matter what anyone says, there will have to be checks on the border if there is no deal. This is E.U. rules.”

He said, “It's going to have a massive effect on our lives.” 

Booth reported from London.