Thirteen people were taken into custody in Istanbul and nine in the coastal city of Izmir, the official said.
Three of those detained were foreign nationals, state media reported.
The official also said that Turkey has determined the attackers who carried out Tuesday's shootings and suicide bombings were from Russia, Uzbekistan, and Kyrgyzstan.
No one has claimed responsibility for the attack that hit one of Europe's busiest transit hubs.
Three terrorists stormed the airport Tuesday night, opening fire and detonating explosives in an attack that killed 42 people and wounded hundreds more.
When the attackers arrived at the Turkish airport armed with rifles and suicide bomb vests, two opened fire and detonated their bombs at the international terminal building, according to officials.
A third one died in the parking lot, where he detonated himself as terrified travelers scattered in all directions.
The attack echoed the dual suicide bombings at the main airport in Brussels in March.
Like the attack in Brussels, the terrorists took a taxi to the airport.
After the terror attack, police interviewed the taxi driver who drove the Istanbul terrorists to the airport and released him, Turkish state news agency Anadolu reported.
Euro 2016: It's Bale vs Hazard as Wales faces 'home team' Belgium
Tour operators brace for hit after Turkey attack
41 dead, 239 injured in Istanbul airport suicide attacks
CIA warns of Istanbul-type attack in US
Former Boston Marathon champ Grigoryeva banned for doping