EDINBURGH — Martin Freeman has revealed how his first audition to play Doctor Watson in the BBC’s “Sherlock” didn’t go according to plan.

Interviewed at the Edinburgh Television Festival, the British star revealed that he had to be invited back for a second audition before he was offered the part opposite Benedict Cumberbatch in one of the most successful TV series of recent times.

“I had to do two auditions before I got the role,” he recalled to interviewer Mark Lawson. “My agent told me they hated me and thought I was a moody prick. … I went back again and read with Ben.”

The rest, as they say, is TV history. Or not quite. Because the original “Sherlock” pilot was rejected and had to be reshot as a 90-minute episode.

“It seemed a bit, silly, but happily I was extremely wrong,” said Freeman, who had landed his first TV role about 15 years earlier on the British cop show “The Bill.”

“I wasn’t very good in it, I wasn’t very good at being in front of the camera,” Freeman remembered. “But it was not a bad first attempt.”

He remembered how he’d been given a grant to attend London stage school, something which would be very rare today when austerity means students have to be self-funding.

He said it concerned him very much that people from ordinary British suburban backgrounds like his would “be unlikely” to attend acting schools today due to financial constraints.

Freeman, who supports the U.K. Labour Party, subsequently got his big break in the original version of “The Office,” co-starring as Tim — a part that got him noticed in Hollywood.

“‘The Office’ was a big open door because every f—er watched it,” Freeman said.

He knew instinctively it was a funny show, despite the lack of either a laughter track or traditional jokes.

“After ‘The Office,’ people thought I was a stand-up comedian, but I’ve always wanted to be a decent actor who can be funny, rather than a comedian.”

Avoiding type-casting, Freeman seems equally at home as Bilbo Baggins in “The Hobbit,” on stage as Richard III and in acclaimed TV roles like “Sherlock” or “Fargo.”

Asked if there was any difference in acting in feature films, compared with TV, Freeman said the two disciples were identical.

In both mediums “you have to convince the audience that this moment in really happening.”

As for working on American TV, Freeman said the big shift was the speed in production schedules.

“When I did ‘Fargo,’ I couldn’t believe how quickly they make quality TV. An episode was done in seven or eight days. There’s a great organizational skill to be able to do that.

“Otherwise it’s the same … the same tribulations, the same discomforts.”

There was another big difference that did not impact on him. Asked about diversity by an Edinburgh delegate, Freeman recalled Idris Elba telling him that he was going to work in the U.S. because of the lack of parts for black actors in the U.K. TV and film biz.

“There is a different ceiling there (in the U.S.) … I can’t be any more profound than that.”

Freeman said getting the part of Bilbo in “The Hobbit” enabled him to effectively walk into “Fargo.”

“I guess it wouldn’t have happened the way it did without ‘The Hobbit,’” he said. “Without it, I would have had to jump through some hoops.”

However, there’s a downside to being part of a Hollywood franchise. “If I want to go out and buy a pint of milk it takes an hour,” he said, because he’s constantly recognized.

“It’s not terrible, but I wouldn’t say it’s my favorite thing in the world. … People don’t go into acting for the fame, they do it because they like the work.”