Theresa May’s speech-writers have been left red-faced after it emerged a pre-briefed section of her keynote conference address closely matched one given by a fictional character in the TV show The West Wing.

The words used to set out her party’s abilities to meet the huge challenges facing the UK were similar to ones uttered by President Jed Bartlet, played by Martin Sheen in the hit programme.

It emerged hours before Ms May was to take to the stage in Manchester to address the party faithful in a bid to get her administration back on track.

A section of the speech briefed overnight had the Prime Minister saying: “It is when tested the most that we reach deep within ourselves and find that our capacity to rise to the challenge before us may well be limitless.”

The line was supposed to be a section of the speech boosting the Tory troops and calling on her cabinet to pull together and “shape up” in the national interest.

But political journalists who are among some of The West Wing’s biggest fans felt they had heard the passage before.

In episode one of season 4, entitled ‘20 Hours in America’, President Bartlet says: “Every time we think we have measured our capacity to meet a challenge, we look up and we’re reminded that that capacity may well be limitless.”

It would not be the first time that a politician’s speech has felt vaguely familiar.

Jeremy Corbyn’s conference speech in 2015 was followed by a row when it emerged the leadership team used a lengthy passage written years before by the author and former political adviser Richard Heller.

Tory conference 2017 – in pictures Show all 23 1 /23 Tory conference 2017 – in pictures Tory conference 2017 – in pictures Comedian Simon Brodkin hands Theresa May a p45 during her conference speech @simonbrodkin/Twitter screengrab Tory conference 2017 – in pictures Britain's Prime Minister Theresa May struggles with her water after she suffered a coughing fit whilst addressing the Conservative Party conference in Manchester Reuters Tory conference 2017 – in pictures Britain's Foreign Secretary Boris Johnson delivers his speech on the third day of the Conservative Party annual conference Tory conference 2017 – in pictures Bear Grylls at the Conservative party conference at the Manchester Central Convention Complex PA Tory conference 2017 – in pictures Britain's International Development Secretary Priti Patel gestures after delivering her speech on the third day of the Conservative Party conference Paul Ellis/AFP Tory conference 2017 – in pictures Prime Minister Theresa May and Chancellor Philip Hammond visit a home in Manchester during the Conservative Party conference in the city Phil Noble/PA Tory conference 2017 – in pictures Britain's Foreign Secretary Boris Johnson returns from a morning run on the second day of the Conservative Party Conference, in Manchester Reuters/Phil Noble Tory conference 2017 – in pictures Delegates view a display board showing the history of the Conservative Party as they arrive for the first day of the annual Conservative Party conference Getty Tory conference 2017 – in pictures Delegates carry pro-Brexit bags as they arrive for the first day of the annual Conservative Party conference Getty Tory conference 2017 – in pictures Delegates listen to Justine Greening's speech on the first day of conference Carl Court/Getty Tory conference 2017 – in pictures Britain's Prime Minister Theresa May and her husband Philip applaud a speaker on the first day of the annual Conservative Party conference Carl Court/Getty Tory conference 2017 – in pictures Scottish Conservative leader Ruth Davidson speaks at the Conservative Party Conference at the Manchester Central Convention Complex PA Tory conference 2017 – in pictures Secretary of State for Education, Justine Greening, speaks on the first day of the conference Carl Court/Getty Tory conference 2017 – in pictures Chairman of the Conservative Party, Patrick McLoughlin, speaks at the opening of the first day of the Tory party conference Tory conference 2017 – in pictures Chancellor of the Exchequer, Philip Hammond, arrives for the first day of Tory party conference Carl Court/Getty Tory conference 2017 – in pictures Secretary of State for Defence, Michael Fallon, arrives at conference Getty Tory conference 2017 – in pictures Home Secretary, Amber Rudd (C), attends the first day of the Conservative Party conference Carl Court/Getty Tory conference 2017 – in pictures Secretary of State for Communities and Local Government, Sajid Javid, attends the first day of the Conservative Party conference Getty Tory conference 2017 – in pictures Former Conservative minister, Edwina Currie, at the first day of conference Carl Court/Getty Tory conference 2017 – in pictures Secretary of State for International Trade, Liam Fox, arrives at conference Carl Court/Getty Tory conference 2017 – in pictures Britain's Foreign Secretary, Boris Johnson, arrives at the conference hotel for the Conservative Party Conference Reuters/Darren Staples Tory conference 2017 – in pictures The anti-Tory march makes its way to the Conservative party conference in Manchester Peter Byrne/PA Tory conference 2017 – in pictures A demonstrator walks a dog wearing a European Union flag during a protest on the opening day of the Conservative Party Conference, in Manchester Reuters/Darren Staples

He had sent the same passage to Ed Miliband in 2011, and had offered versions of it to every leader since Neil Kinnock to no avail.

Kinnock himself had a speech plagiarised by US Democrat politician Joe Biden, albeit before he became a vice president in Barack Obama’s administration.

Mr Obama’s wife, Michelle, then had her own words closely mirrored by her successor as First Lady, Melania Trump.

A number of lines in the speech delivered by Trump at the 2016 Republican national convention appeared to have been lifted verbatim from Obama’s speech at the 2008 Democratic convention.

US First Lady Melania Trump gave a speech that in sections was almost exactly like one delivered by Michelle Obama (AFP/Getty Images)

Obama had said: “Barack and I were raised with so many of the same values, that you work hard for what you want in life, that your word is your bond and you do what you say you’re going to do.

“And Barack and I set out to build lives guided by these values, and pass them on to the next generation. Because we want our children – and all children in this nation – to know that the only limit to the height of your achievements is the reach of your dreams and your willingness to work for them.”

Eight years later Trump told GOP delegates on Monday: “From a young age, my parents impressed on me the values that you work hard for what you want in life, that your word is your bond and you do what you say and keep your promise.