David Cameron made the announcement during a one-day visit to the region on Tuesday.
He said the yearly summit of world leaders will take place at the Lough Erne golf resort outside Enniskillen on 17 and 18 June 2013.
"I think this will be a brilliant advertisement for Northern Ireland," Mr Cameron told guests as he hosted one of his 'Cameron Direct' events at a Co Armagh factory.
"I want the world to see just what a fantastic place Northern Ireland is, a great place for business, a great place for investment.
"A place with an incredibly educated and trained workforce, ready to work for international businesses and also of course, I want to show the world what a beautiful place Northern Ireland is and Lough Erne, where I was this morning, is one of the most beautiful places in the entire United Kingdom."
Heads of eight of the world's richest economies will descend upon the five-star Lough Erne hotel for the summit.
They will include US President Barack Obama and Russian President Vladimir Putin.
Mr Cameron joked: "I hope I won't have any trouble keeping President Obama off the golf course."
G8 will be one of the most high-profile events ever witnessed in NI.
Welcoming the announcement, First Minister Peter Robinson said: "This is a massive boost for us and we look forward to welcoming the leaders of the G8 nations from across the world to this part of the United Kingdom.
"This gathering of leaders from United States, Canada, Russia, Germany, Italy, France, Japan and our own Prime Minister as well as the potential of other world leaders attending will present a particularly unique occasion to promote Northern Ireland across a range of sectors, especially tourism and inward investment potential."
Deputy First Minister Martin McGuinness said: "Ireland, north and south, has suffered terribly as the result of the world recession caused by the irresponsible behaviour of financial institutions and some governments.
"I hope G8 leaders when they come to Fermanagh will recognise and accept the need to do something deep and profound to assist people, many millions of whom are the poorest on the planet today."
Each of the G8 member countries take it in turns to host the summit, with last year's having been held at Camp David in the US state of Maryland.
The last time the G8 was held in the UK was at Gleneagles in Scotland in 2005.
Stormont Enterprise Minister Arlene Foster said it is "marvellous" news for the local economy that the 39th annual summit will take place in Fermanagh.
There is also hope it could secure the long-term future of the Lough Erne resort, which went into administration four years after opening, owing the bank £25m.
Ms Foster said: "The Lough Erne resort faced stiff competition from several other locations across the UK and I am delighted that it has been chosen as the most suitable host venue.
"The Lough Erne resort will now join other world famous venues like Camp David and Gleneagles on the impressive list of host locations. Hosting the G8 summit will put Northern Ireland firmly in the global spotlight once again and we must grasp the opportunity to further build our profile on the world stage."
Lough Erne general manager Ferghal Purcell, who spoke to Mr Cameron earlier, said: "Hosting such a significant event here at Lough Erne Resort is great for the people of Enniskillen, for the region, for Northern Ireland and the island as a whole.
"The eyes of the world will be on us, and we are more than proud to have our beautiful resort selected as the venue and the backdrop for this prestigious meeting. We look forward to giving the delegates, the guests and the world's media a true Northern Ireland welcome."
Tourism chiefs are hopeful NI can take advantage of the international spotlight.
Brian Ambrose, Chairman of Tourism Ireland, said: "This is an unprecedented opportunity to showcase Northern Ireland - not only to world leaders but also to the international media.
"It will raise the profile of Northern Ireland and ultimately help us achieve our goal of increasing visitor numbers from overseas."
Meanwhile small businesses have also welcomed the news.
In a joint statement, Glyn Roberts of the NI Independent Retail Trade Association and Joe Kelly of Enniskillen Partnership said: "For both the local retail and hospitality sectors this is a world class opportunity to profile both Fermanagh and Northern Ireland as a whole.
"This will be a huge boost to the local economy with unprecedented world-wide marketing potential to grow tourism."
The announcement adds to what is expected to be a huge year for NI in 2013, with Londonderry set to become the first ever UK City of Culture and Belfast to host the World Police and Fire Games.