Yeah, sorry about the girl - such a pretty thing. What a Queen she would've made.
~ The Sheriff to the Doctor when he thinks Clara is dead.

The Sheriff of Nottingham is the main antagonist of the Doctor Who episode "Robot of Sherwood". He is based on The Sheriff of Nottingham in the Robin Hood legend. Sometime before the events of the episode, a spaceship came to Earth in Sherwood Forest and disguised itself as a castle where the robots on board had joined forces with the Sheriff who wished to become King of England so he along with the robots disguised as knights collected all the gold in the land in order to power the ship where he would go to London to take over ruling. One time, the Sheriff held an archery contest where the winner would win a golden arrow where one time, Robin Hood under the name of Tom the Tinker took part where he competed with the Sheriff where it Robin won by splitting the Sheriff's arrow. But just as Robin was about to be given the golden arrow, another arrow split his arrow which was fired by The Twelfth Doctor before blowing up the target with his sonic screwdriver and learned that the knights were robots just before the Sheriff ordered the robots to seize the Doctor, his companion Clara Oswald and Robin.

The Sheriff then summoned Clara and revealed to her his plan to become King and wishing for Clara to be his Queen tried to kiss her but she stop him. Later he took Clara to the ship's control room where he finds the Doctor and Robin there. Robin and Clara are able to escape by jumping out of a window into the water below but the Doctor is once again imprisoned.

The Doctor however spurs a rebellion, and along with the other peasants in the castle use gold plates to fight the robot knights as their lasers bounce off the gold and destroys them before being confronted by the Sheriff and two other robot knights. Robin and Clara return to help the Doctor where a sword fight starts between Robin and the Sheriff and the two fight on top of a wooden beam and the Sheriff disarms Robin but luckily Robin is able to defeat the Sheriff by knocking him into a vat of molten gold.

(In a cut scene from the episode, during the sword fight Robin beheads the Sheriff who is revealed to be a robot and later reattaches his head to his body).

He is played by Ben Miller.