The lights are being switched off on the world’s stage. The United Nations security council has heard the latest horrific news from Yemen and is shutting up for the evening as the sunset reflects pink off New York’s East River. Karen Pierce, the UK’s ambassador, who fights the country’s diplomatic battles in the cockpit of the council, has just stepped away from the chamber’s famous C-shaped negotiating table and has a gap between the Yemen session and a dinner event on nuclear disarmament. Pierce tells an aide she will go to the dinner, but will not be eating. “I will, however, need a stiff drink.”

While the political class back home is consumed with Brexit and finds itself derided and increasingly ignored in Europe, Britain still wields the clout of a major power at the UN. The privileges the UK acquired when it emerged as a victor of the second world war – permanent membership of the security council and the veto power that comes with it – cannot be taken away without Britain and the four other permanent members – China, France, Russia and the US – voting for it.

It is Pierce’s job to wield that clout. She is the first woman to do so, a reflection of the glacial pace of change at the Foreign Office, where women have only recently been given a shot at the plum ambassadorial posts. Diplomats and observers agree she has been a robust presence since starting the job in March. Her style is resolutely direct and informal. At a climactic security council session, she wore a leather jacket and a red-and-black boa. While many British diplomats have become more taciturn as the Brexit saga has worsened and the treasured “special relationship” has become hostage to Donald Trump’s antics, Pierce has remained garrulous and relaxed around journalists.

It’s good to be seen to stand up to Russia in public and show there’s a pushback on the lies that they try to tell

Unusually for a permanent representative, as ambassadors to the UN are called, she often addresses the security council without notes and has engaged in pointed ad lib exchanges with her Russian opposite number, Vassily Nebenzia, over Syria and the nerve agent attack on the Skripals in Salisbury. In a surreal encounter in April, the two diplomats traded barbed cultural references. Nebenzia scorned the idea that the Russians would do anything as blatant as using novichok poison in broad daylight in an English city. Anyone who watched Midsomer Murders could do better, the Russian envoy sneered. Pierce struck back with Sherlock Holmes. Allowing the Russians to take part in the Skripal investigation, she said, would be like “Scotland Yard inviting in Professor Moriarty”. Nebenzia – whose mirthless grin and shiny, bald pate would make him a passable Blofeld in any UN-themed Bond remake – countered by reading a passage from Alice’s Adventures in Wonderland in which the queen demands “sentence first – verdict afterward”. Pierce quickly retorted that her Russian colleague might be better served by the quote: “Sometimes I’ve believed as many as six impossible things before breakfast.”

Speaking in a small, plain room in the UN headquarters, Pierce says: “There’s a little bit of theatre in it. It’s partly about showing the Russians we can’t be pushed around. It’s good to be able to be seen to stand up to them in public in the security council and show them that the arguments don’t go their own way and that there’s a pushback on the stories and lies that they try to tell.”

It is diplomacy almost as a contact sport. A week after the literary skirmish, the Russians suffered an embarrassing defeat, mustering only two other votes – from China and Bolivia – in the 15-member security council for a resolution condemning US air strikes to punish the Syrian regime for using chemical weapons. Pierce called over one of Nebenzia’s deputies, Vladimir Safronkov, a burly man who towered over her, and gleefully held up three fingers to his lapel. “Three again. You only got three,” Pierce taunted. “Just like Kosovo.” Pierce was rubbing salt in the wound. Almost 20 years ago, Safronkov was involved in a Russian effort to stop the Nato intervention in Kosovo, one that mustered the same paltry tally of votes. “It just helps the Russians to be reminded of where the bulk of UN opinion is,” Pierce says. “It’s quite an interesting indicator of where the true centre ground lies.”

Pierce at a security council meeting on the Middle East on 18 October. Photograph: Atılgan Özdil/Anadolu Agency/Getty Images

She adds that Safronkov took her three-fingered challenge in good humour and that she maintains a polite working relationship with her nemesis on the council, Nebenzia. “On the whole, at the moment, most of the council members get on reasonably well personally and that helps,” Pierce says. There is no point in bearing grudges, as the next day there could be a debate on another crisis where “we might want to have unity on the council so that we can help make something positive happen”.

The positives have been hard to come by at the security council, the job of which is to confront the worst that humanity has to offer. It hears daily reports of barbarity in Syria or the man-made famine in Yemen. In April, the permanent representatives went to Myanmar and visited the Rohingya refugee camps in Bangladesh, where they were plunged into a scene of human misery. “I had one girl throw herself on me. All her family, her parents and uncles and aunts, had been killed in front of her,” Pierce says. They met young boys who had been crippled by mines and were too traumatised to remember what had happened to them.

She had been sceptical of the practice of security-council excursions, suspecting they were no more than diplomatic tourism, but the brutal realities of the atrocities perpetrated on the Rohingya changed her mind. “The scale was just unimaginable,” she says. At least one of the ambassadors broke down in tears. When they went to visit Aung San Suu Kyi, “she didn’t seem to comprehend the scale of what needed to be done to put this right. Accountability seemed to be something that could be dealt with in a very leisurely fashion to her,” Pierce says. Her ministers blamed the refugees for their predicament, saying they had failed to fill in their repatriation forms correctly. Pierce had met Aung San Suu Kyi years before in Switzerland and had been struck by her calm charisma. This time, she says ruefully: “I think everyone was just bitterly disappointed.”

As we leave the EU, the UN will be an even bigger stage for the UK to be an independent force – hopefully for good

The founders of the UN envisaged the security council as a keeper of global peace, but it is an ideal that has rarely been lived up to. In almost every mass killing of recent decades, one or more of the permanent council members has been friend and protector of the killers. In Myanmar, it is China; in Syria, it is Russia. In Yemen, the US, France and the UK are serving as quartermasters for the coalition, led by Saudi Arabia, whose relentless aerial bombardment has caused most of civilian deaths. The UK continues to sell arms to Riyadh through one outrage after another, including the bombing of a bus that killed 40 boys going on a school trip. For all the uproar over the cold-blooded murder of the dissident writer Jamal Khashoggi in the Saudi Arabian consulate in Istanbul, there are no signs that the UK will suspend sales of arms and military hardware, which were worth more than £1.1bn in 2017.

“The Saudis buy their weapons from a range of countries,” Pierce says. “They would simply buy more from Russia and China if the west did not supply them with arms. But, in any event, the UK has a very strict code of conduct when it comes to arms sales to Saudi Arabia; certain criteria must be met.” Ministers have to certify that Saudi Arabia is trying sufficiently hard not to kill innocent people, she adds.

UK ministers, as with those in the Trump administration, have found ways to continue certifying weapons sales to Saudi Arabia in the absence of evidence that the civilian death toll from the bombing is coming down. Saudi Arabian investigators find their armed forces blameless in the overwhelming majority of cases. Britain’s role in Yemen has been condemned in parliament and by human rights groups, but the official line goes largely unchallenged at the UN, where Russia and China are reluctant to put human rights high up the agenda.

The security council has remained fairly united on Yemen by focusing on humanitarian aid issues and pushing for UN-brokered negotiations. Pierce makes the distinction between Syria – which she describes as “a great power question” between Russia and the US – where the security council is divided and paralysed, and Yemen, which Pierce says is “a test case for the UN”, as its role as a potential peacebroker is acknowledged by the coalition led by Saudi Arabia and the Houthi rebels, who are backed by Iran.

“I suspect that the secretary general himself [António Guterres] is going to have to get more and more engaged to actually land this,” Pierce says. “And, at some point, there will be an Iranian angle. So, again, the UN is probably best placed to handle the Iran angle.”

‘The scale was just unimaginable’ ... Pierce with a Rohingya refugee in Bangladesh in April. Photograph: Michelle Nichols/Reuters

In the breadth and global importance of the issues covered, and the daily necessity to negotiate alliances and do diplomatic battle with adversaries, there is no job in British diplomacy like permanent representative to the UN. Pierce has served as special representative for Afghanistan and Pakistan, ambassador to the UN and other international organisations in Geneva and director general for political affairs at the FCO. But this job, she says, with all its raw geopolitics, is the summit. It is a role she has been preparing for for a long time. She grew up in Preston in Lancashire, “reading boy’s books and drawing fighter jets in art class”. Her northern accent was stripped away at a young age by elocution lessons. “My mother says that’s because I stammered when I was a little girl,” Pierce says, although she sounds sceptical of the explanation. In those days, having a strong regional accent was not seen as the way to get on in life.

Pierce identifies the decisive moment in her early life as sitting at the breakfast table aged about 11 and staring at a photograph of an African American diplomat boarding a battleship in some sunny, foreign place. That woman was almost certainly Eleanor Hicks, an extraordinarily charismatic figure and one of the very few African American women who served in senior roles abroad for the US state department in the early 70s. Hicks was the US representative in Nice and her wit, beauty and fashion sense made her a sensation in colour magazines around the world.

“I definitely remember being attracted by the blue of the sky, the white of her suit and her black skin, the grey and the whites of the sailors,” Pierce says. “It was a stunning photograph. I didn’t understand where it was, but it wasn’t Preston.”

Now that Pierce has broken through all the glass ceilings of the FCO to reach the UK seat on the security council, there is a danger that she has arrived at the moment the country she represents is about to plummet in its global influence. After Brexit – the economic consequences of which could be disastrous – Britain will not be able to claim to be a bridge between the US and the EU. France will be the sole representative of the EU on the security council and therefore take the lead in most collective action the EU attempts in the council and in the UN as a whole.

Pierce argues that European countries will continue to support each other at the UN on the basis of common values, rather than EU membership. “As we leave the EU, the UN will be an even bigger stage for the UK to be an active, independent force – hopefully a force for good,” she says. She can see the UK fighting to preserve a rule-based international order in the face of assaults from Russia and its allies. “I think, without blowing our own trumpet too much, most people here would think that was a good role for the UK.”

And what if Brexit triggers Scottish independence and the implosion of the UK, which would presumably put its privileged seat on the security council under threat? “We’re not planning on that,” Pierce says briskly. “We’re not thinking that will happen.”

Brexit has not come yet and the kingdom remains united, for now. Britain still has its little suite of rooms tucked away in the eaves of the security council and most denizens of the UN headquarters agree that Pierce has brought some much-needed confidence and flair to arguing Britain’s corner in the world’s biggest arena.

Meanwhile, the sun has gone down on the East River, but Pierce still has another two events to attend before that stiff drink.