Azerbaijan claimed their 11th gold medal of the 2017 Islamic Solidarity Games in the women's artistic gymnastics team event, before Turkey followed suit in the men's competition in Baku on Sunday.
The hosts wrapped up their women's team gold medal early in the session as they held off Turkey to win by 3.400 points on 99.300 overall at the National Gymnastics Arena.
The Azeribaijani men put some pressure on Turkey, but the overnight leaders held their nerve in a thrilling finish to seal the title with a 1.35-point margin on 162.800.
The best two results from each apparatus were tallied to give a team total, during a competition that doubled up as qualification for Monday's individual apparatus finals.
Solid floor routines from Yuliya Inshina and Ekaterina Tishkova extended the hosts' lead in the women's team event to 4.950 points going into the final rotation.
Azerbaijan just needed two beam routines without glaring errors to wrap up the title, as rivals Turkey competed next to them on the floor.
Goksu Uctas Sanli (12.900) and Ekin Morova (12.400) did apply a little pressuren, but Marina Nekrasova responded with the best beam of the competition to score 12.600 and seal the home country's first artistic gymnastics gold medal of the Games in style.
Indonesia took the bronze by virtue of being the only other team competing.
- Turkey prevent double Azeri delight -
Turkey led the men's competition by 1.650 going into the second and final day, but Azerbaijan had a great opportunity to take control as they were performing first.
Murad Agharzayev wasn't at his best, but Bence Talas' fantastic high bar (14.150) and solid vault (13.150) kept his team in gold-medal contention going into their last apparatus, the pommel horse.
Teenager Agharzayev picked up 13.850, before Talas produced the goods at the perfect time. The man from Budapest pulled off a tricky routine and nailed his dismount to roars from the crowd, which only increased in volume when they saw his score of 14.100.
That effort gave Azerbaijan a final total of 161.450 ahead of Turkey's last three rotations. The fans, although aware of the situation, were happy to cheer on Azerbaijan's traditional good friends as they solidified their lead in the high bar.
The home team had struggled in the vault and Turkey made them pay thanks to Ferhat Arican (13.400) and Ahmet Onder (14.100). That left Turkey needing a score of just 24.750 on the pommel horse to pip the Azeris to the gold medal. But Ibrahim Colak stuttered and made a mess of the dismount to leave his teammates with plenty to do.
Onder was clean through his effort, although scored only 12.400, leaving it all down to Arican. The 23-year-old held up under the intense pressure and the victory for Turkey was confirmed after an agonising wait when his score of 13.650 was flashed up on the big screen. Iran completed the podium ahead of Algeria and Indonesia.
Monday's individual finals will see six gold medals on offer for the men, and four for the women.