The votes came just days after five Arab countries cut ties with Qatar.
The deal on deploying troops on Qatari soil to improve the country's army and boost military cooperation was signed in April 2016, in the Gulf country’s capital Doha.
Under the bill, the armies of the two countries will also be able to carry out joint exercises. The move aims to contribute to regional and world peace.
In addition, the Turkish gendarmerie will be able to train Qatar’s gendarmerie forces under a deal between the two countries’ interior ministries signed in December 2015.
On Monday, five Arab countries -- Saudi Arabia, Egypt, the United Arab Emirates, Bahrain and Yemen -- cut ties with Qatar, accusing Doha of supporting terrorism.
Qatar denied the accusations, calling the move "unjustified".
The escalation came two weeks after the website of Qatar’s official news agency was allegedly hacked by unknown individuals who reportedly published statements attributed to the country’s Emir, Sheikh Tamim bin Hamad al-Thani.
The incident triggered a diplomatic row between Qatar and its neighbors.