The diagnosis comes as the country grapples with a deadly third wave of a virus that has already killed nearly 13,800 people from more than 620,000 infections - although limited testing suggests real figures are likely much higher.
Khan was suffering from a mild cough and a mild fever, his spokesman Shahbaz Gill later added, saying the positive test was performed on Saturday.
Imran Khan, the prime minister of Pakistan, has tested positive for the coronavirus. He received his first dose of a Covid vaccine two days ago, and doctors believe he was infected beforehand. https://t.co/XeL2VxKPwj pic.twitter.com/wT7IPd54sy— New York Times World (@nytimesworld) March 20, 2021
His aides were quick to put distance between the diagnosis and his first jab of the two-dose vaccine.
'Please do not link it to the corona vaccine. Immunity develops a few weeks after the vaccine is given. Make sure to vaccinate your elders and loved ones. Be careful,' Gill added.
Khan was probably infected before he got the vaccine shot, during a series of public engagements this week, information minister Shibli Faraz told the Geo News television channel.
Khan is 'self isolating at home,' said minister Faisal Sultan in a tweet, without giving further details as to whether other people who have been in contact with Khan would also be isolating.
Khan has been holding regular and frequent meetings lately, including attending a security conference held in capital Islamabad that was attended by a large number of people.
He addressed the conference without wearing a mask, and attended another gathering to inaugurate a housing project for poor people in a similar fashion on Friday.
The 68-year-old received a shot of the Chinese-produced Sinopharm vaccine on Thursday - one of over a million doses donated to Pakistan by Beijing.
Earlier Saturday, the leader's adviser on health Faisal Sultan said the increase in positive virus cases over the past few days was 'alarming'.
He said there was a 'quite visible' burden on the healthcare system, particularly in the country's most populous province of Punjab.
Pakistani Prime Minister Imran Khan has tested positive for the coronavirus two days after he received his first vaccine dose, officials say. https://t.co/NR5GcXviXI— ABC News (@ABC) March 21, 2021
The impoverished nation of 220 million has largely avoided the kind of major lockdowns seen in other countries, instead opting for 'smart' containment policies which see neighbourhoods closed off for short periods.
However, many guidelines have been ignored, with Sultan criticising 'a lack of administrative action and a lack of public compliance'.
Soon after the pandemic started the former cricket star told the nation in an address not to panic, saying '97 percent of patients fully recover', but he chided citizens just months later warning: 'People are not taking it seriously.'
According to numbers released by government, 3,876 people tested positive in the last 24 hours, the highest number of daily infections since early July, taking the total number of infections in the country past 620,000.
There were also 42 more deaths, taking the total to 13,799.
Pakistan launched vaccinations for the general public on March 10, starting with elderly people after seeing a poor response from frontline health workers, who expressed concerns about Chinese vaccines.
Chinese Sinopharm and CanSinoBio, Oxford-AstraZeneca and Russia's Sputnik V vaccines have been approved for emergency use in Pakistan.
© Associated Newspapers Ltd.