Updated

A chastened Prime Minister Theresa May made progress Tuesday in securing a deal with a small Northern Ireland party with whom she hopes to govern, just days after a catastrophic election wiped out her majority in Parliament.

May desperately needs the Democratic Unionist Party's 10 seats to pass legislation. The Conservatives are considering an arrangement in which the DUP backs May on the budget and her confidence motions in return for policies favorable to Northern Ireland — a situation that could lead to huge benefits for a small part of the United Kingdom.

Party leader Arlene Foster seemed buoyant as she arrived at May's Downing Street office — and her good mood just kept on going.

"We've had some very good discussions today and those discussions are continuing this afternoon," she said. "I hope that we can reach a conclusion sooner than later."

In a reflection of her newfound humility, May managed a joke at her own expense as Britain's House of Commons got underway in the first sitting after Thursday's general election.

After House Speaker John Bercow was re-elected without challenge, a chastened May quipped: "At least someone got a landslide."

May had called the vote early in hopes of strengthening her majority going into talks on exiting the European Union. Instead, she found the opposition Labour Party unexpectedly making a strong second-place showing and national politics thrown into disarray.

Labour leader Jeremy Corbyn countered with a bit of previously unseen swagger, wearing a huge red rose — his party's symbol — in his lapel as he sparred with May and taunted her about the uncertainty surrounding the upcoming vote on her legislative program, known as the Queen's Speech.

"I congratulate her on returning and I'm sure she'll agree with me that democracy is a wondrous thing, and can throw up some very unexpected results," he said.

He added: "I'm sure we all look forward to welcoming the Queen's Speech just as soon as the coalition of chaos has been negotiated." During the election campaign, May had used the "coalition of chaos" phrase to describe what a victory for Labour would look like.

The talks with the DUP follow May's apology to Conservative rank-and-file lawmakers in a meeting Monday that signaled she would be more open to consultation, particularly with business leaders demanding answers about the details on Britain's departure from the European Union.

"I'm the person who got us into this mess and I'm the one who will get us out of it," she said.

May is under pressure to take on a more cross-party approach to Brexit talks. The Evening Standard, edited by ex-Treasury chief George Osborne, reported that Cabinet ministers have initiated talks with Labour lawmakers to come up with a "softer," less hard-line divorce from the EU.

Environment Secretary Michael Gove declined to deny the reports when pressed, but told Sky News that the reality of the election result meant that May and her government would need to reach beyond party lines.

"The parliamentary arithmetic is such that we are going to have to work with everyone," he said.

Foster will almost certainly ask for greater investment in Northern Ireland as part of the deal, as well as guarantees on support for pension plans and for winter fuel allowances for older people.

Though Foster supported Brexit, she also might demand that May pursue a cushioned exit from the EU, given her party's wish that a soft border remain between Northern Ireland and Ireland, an EU member.

Even the idea of an alliance is complicated, however. Some involved in the Irish peace process are alarmed because the 1998 Good Friday peace accords call for the British government to be neutral in the politics of Northern Ireland.

Foster's rivals in Northern Ireland, such as Sinn Fein's Gerry Adams, have objected.

"Any deal which undercuts in any way the process here or the Good Friday Agreement is one which has to be opposed," he said.

The stakes for May are high. Without a so-called confidence and supply deal with the DUP, her party risks losing the vote next week on the Queen's Speech. If that happens, Corbyn will demand a chance to try to form a government by uniting progressive factors in the House of Commons.

"The Labour Party stands ready to offer strong and stable leadership in the national interest," he said.

Meanwhile, the chief EU negotiator has told the Financial Times that the clock is ticking on Brexit talks, and that Britain should be wary of further delays. Michel Barnier warned that no progress had been made in the three months since May triggered Article 50 to start the process of leaving the union.

"My preoccupation is that time is passing, it is passing quicker than anyone believes because the subjects we have to deal with are extraordinarily complex," he added. "I can't negotiate with myself."