London: Both countries were confirmed as full members after a unanimous vote at an International Cricket Council (ICC) meeting during its annual conference in London.
Now the Ireland and Afghanistan's men's teams will be eligible to play five-day Test cricket, widely regarded as the sport's supreme format.
Bangladesh were previously the last country to be granted Test status in 2000.
Afghanistan and Ireland have joined an exclusive club that also includes founder members Australia and England, who played the first Test match at Melbourne in 1877, South Africa, New Zealand, the West Indies, India, Pakistan, Sri Lanka and Zimbabwe.
"It's fantastic news for all involved with Irish cricket and I'd like to thank the ICC and the members for the positive outcome," said Cricket Ireland chief executive Warren Deutrom in a statement.
"Test cricket is the pinnacle of the sport and it's what we've all been aiming for."
Ireland captain William Porterfield emphasised the point.
"We have all played in World Cups and achieved some memorable results along the way, but to play in a Test would be a bit special," he said.
Meanwhile Afghanistan Cricket Board chief executive Shafiq Stanikzai said: "For a nation like Afghanistan it is a huge and remarkable achievement, the entire nation will be celebrating.
"Afghanistan cricket has gone from strength to strength and we dared to dream that this would happen and today it has become a reality."
Afghanistan international Mohammad Nabi took to Twitter to say: "Finally our hard work pays off and the dream of @ICC Full-Membership comes true."
Stanikzai said in a subsequent conference call with reporters that he would "consult with the "Full (Test) members in our region," regarding the staging of Afghanistan's first Test.
The team have recently played home matches in the Indian city of Noida because of security concerns.
Many Afghans' first contact with cricket only took place during the 1980s and 1990s, as refugees fled to Pakistan to escape the Soviet invasion.
By contrast, cricket has been played in Ireland for nearly 200 years.
But it wasn't until 1969 that Ireland made the rest of the world game sit up when they bowled out the West Indies for just 25 at Sion Mills.
Ireland have since established themselves during the course of several World Cups, recording one-day international wins over Pakistan, the West Indies and England.
Now the Taoiseach, or Prime Minister, of the southern Republic of Ireland, Leo Varadkar, wants to see that success carried on into the Test arena.
When each nation became a full member, thus gaining Test status
1909 - England (founder member)
1909 - Australia (founder member)
1909 - South Africa (founder member)
1926 - India
1926 - New Zealand
1926 - West Indies
1952 - Pakistan
1981 - Sri Lanka
1992 - Zimbabwe
2000 - Bangladesh
2017 - Ireland
2017 - Afghanistan