Northern Ireland will play Slovakia in Trnava on Saturday 4 June in their final preparation game ahead of the Euro 2016 finals in France.
The international friendly between the European Championship finalists will be staged at the new City Arena Stadium.
The following day, Northern Ireland will travel to their base camp in France to complete their preparations.
Michael O’Neill’s side will play Poland in their first group game in Nice on 12 June.
Slovakia, placed 25th in the Fifa rankings, automatically booked their place at the Euros after finishing runners-up to Spain in their qualifying group.
They will take on England, Wales and Russia in Group B at Euro 2016.
They were also in the same qualifying group as Ukraine, who Northern Ireland will face in Lyon on 16 June in their second group match, winning 1-0 in Ukraine and drawing 0-0 at home.
Famous win over Spain
Slovakia also registered a famous win against Spain in qualifying, their 2-1 home victory against the reigning European champions in Zilina in October 2014 ending Spain’s eight-year, 31-match unbeaten run in the competition.
Northern Ireland manager Michael O’Neill said: “I think this will be a good game for us. Slovakia play in a similar style to Poland and Ukraine.
“I wanted one game at home and one game away before going to France. This game is eight days before our opening game in France and I feel that is ideal.
“It will also allow us to have a training camp in central Europe before we head off to France.”
Northern Ireland last played Slovakia during the 2010 World Cup qualifying campaign, losing both games, 2-1 away and 2-0 at home.
Details of Northern Ireland’s final home friendly in the run-up to the Euros – which will be staged towards the end of May – are still to be confirmed.