Greater Manchester Police said the man sustained ‘serious injuries to his face’ in the attack, which occured on Thursday lunchtime outside the Elms Medical Centre in Bury.
Two men wearing hoodies were seen attacking the man on practice premises as he was getting into his car, before leaving the scene in a Vauxhall Astra.
Police appealed for anyone with information to contact police on 101 or Crimestoppers. The locum has since received medical treatment in hospital.
Detective Inspector John Stainton said: ‘I know this incident is going to cause some concern to people living and working in the area, but I would like to assure them that we have launched a full investigation and are actively searching for those responsible.
‘This was an unprovoked attack on a man as he got into his car which understandably left him feeling traumatised and requiring medical treatment.
‘We are keen to speak with anyone who may have information about what happened which could possibly assist us with our enquiries.’
GPs have previously called for a system to warn practices if a newly-registered patient has a history of violence. One GPonline poll found that four out of five GPs have felt threatened by a patient in their practice at some point in their career.