Boris Johnson was given the vaccine at St Thomas' Hospital in central London, where he was treated for Covid-19 during the first wave of the pandemic.
After being vaccinated, the PM said: "I cannot recommend it too highly".
It comes as several European countries said they would resume using the jab.
Leaving hospital, Mr Johnson told reporters: "I literally did not feel a thing. It was very good, very quick - I cannot recommend it too highly.
"Everybody, when you do get your notification to go for a jab, please go and get it, it is the best thing for you, best thing for your family and for everyone else."
More than 26 million people have now had their first dose of a coronavirus vaccine in the UK, according to the latest government figures. About two million people have had a second dose.
In England, 22,337,590 people had been given a first jab as of 18 March, according to NHS England, the equivalent of 50.5% of the population aged 18 and over.
Vaccines minister Nadhim Zahawi also received his vaccination at a pharmacy in Lewisham, south-east London, earlier.
Meanwhile countries including France, Germany and Italy began restarting their vaccine programmes with the AstraZeneca jab - reversing earlier decisions to suspend them over blood clot concerns.
The resumption of the use of the vaccine comes after the European Medicines Agency confirmed it was "safe and effective".
The regulator reviewed the jab over fears about blood clots, but said it was "not associated" with a higher risk of such events, and that the benefits outweighed any risks.
The World Health Organization and the UK's Medicines and Healthcare products Regulatory Agency have said the jab is safe and have encouraged people to take up their vaccine appointments.
The WHO's advisory committee on vaccine safety issued a statement on Friday saying the vaccine "continues to have a positive benefit-risk profile, with tremendous potential to prevent infections and reduce deaths across the world".
On Thursday, the prime minister reiterated that the jab was safe and urged people to take the vaccine if they were offered it.
He said: "The thing that isn't safe is catching Covid, which is why it's so important that we all get our jabs as soon as our turn comes."
He also insisted that delays to the UK's Covid vaccine supply in April would not affect people getting their second doses, or England's road map out of lockdown.
"The way to ensure this [lockdown easing] happens is to get that jab when your turn comes, so let's get the jab done," he said.
In other developments, ONS figures suggest infection levels have continued to fall across England and Wales but have "levelled off" in Northern Ireland and increased in Scotland.
An estimated one in 335 people in the UK had Covid-19 in the week to 13 March, according to the figures, down from one in 280 last week.
On Friday, the UK reported a further 101 deaths and 4,802 cases, according to the government's separate daily coronavirus figures.