Since being admitted into UEFA in 2013, the lack of suitable facilities has meant Gibraltar have played home international fixtures in Faro, Portugal.
The GFA will invest approximately £32 million (€38.1m, $40.8m) to buy the municipal Victoria Stadium from the Gibraltar Government for £16.5 million and invest a similar amount in upgrading the facility to meet UEFA standards.
"Her Majesty's Government of Gibraltar is delighted to announce that agreement has now finally been reached with the Gibraltar Football Association on the construction of a UEFA Category 4 National Football Stadium in Gibraltar," said a government statement.
"The GFA also informs the Government that the Gibraltar National Football Squad will be able to play all its UEFA and FIFA internationals in Gibraltar as from 2018."
The Victoria Stadium, which currently has a 2,500-seat capacity, had initially been ruled out by UEFA as it failed to meet their requirements for international matches.
However, the GFA's plans to build a stadium in other locations encountered public resistance.
UEFA has now accepted that Victoria Stadium is the only feasible site, although only on condition that it was sold to the GFA.
"Football will finally come home," said Dennis Beiso, GFA general secretary.
"There will be no repeats of the current situation where our clubs and our national teams are not allowed to play at their home stadium because the facilities do not meet standards."
The project will be financed using UEFA and FIFA infrastructure funding.