Various videos taken earlier on Wednesday showed at least two people firing pistols near the entrance to Turkish Aerospace Industries (TAI), located about 40 km (25 miles) from the capital.
Turkish Vice President Cevdet Yilmaz said four of the victims were TAI employees and the fifth was a taxi driver.
Local media earlier reported that the attackers killed a taxi driver before taking his vehicle to carry out the attack.
The explosion occurred around shift change, and employees had to be sent to a shelter, they said.
Yerlikaya also confirmed that seven special forces fighters were among the 22 injured in the attack.
The PKK is banned as a terrorist organization in Turkey, the US and the UK and has been fighting against the Turkish state since the 1980s for greater rights for the country’s sizeable Kurdish minority.
Turkish President Recep Tayyip Erdogan, who is in Russia for the BRICS summit, condemned what he called a “heinous terrorist attack” during a meeting with Russian President Vladimir Putin on live television.
He later released a lengthy statement on X, saying that security forces had acted quickly to neutralize the threat and that “no terrorist organization, no criminal target targeting our security, will be able to achieve their goals.”