For Graham Hickey, discovering Dublin's oldest house was like something out of an Indiana Jones film.

Three years ago, armed with a flashlight, he pulled up the shutters of a house on Thomas Street and walked into a pitch-black derelict building that was crumbling in front of him.

He should have walked away, but Hickey was a man on a mission. The Dublin Civic Trust conservation officer had identified 130 Thomas St as an extremely interesting old building, thanks to its unusual roof structure and chimney, which he had spotted on Google Maps' aerial view.

The building was on the market but it wasn't selling, so Hickey pestered estate agents until he finally got a key to the house.

"The house was literally collapsing in on itself," he says. "Water was pouring through and there were pigeons everywhere."

It didn't look promising but as he continued on his search, Hickey struck gold. "Suddenly, under the flashlights, this beautiful early staircase came into view at the back of the house," says Hickey. "It was absolutely amazing; one of those moments when you know you're bang on the money."

The staircase, with a unique twisted barley sugar shape to the bannisters, confirmed Hickey's suspicions - that this house dated back to sometime in the 1600s. Very few houses in Dublin have survived from that time and in his eagerness to get more information, Hickey nearly didn't make it out.

"The whole thing was collapsing in, the stairs were collapsing as well. I clambered up onto the first floor and I was a bit like Indiana Jones trying to get out again," he says. "The house was unravelling around me and it was very much touch and go getting back out."

With his feet on firm ground again, Hickey wasted no time. He immediately applied to Dublin City Council to have the building listed as a proposed protected structure. But even he had no idea that he had stumbled across Dublin's oldest house.

Builder Paul Sinnott, originally from Wexford but living in Kildare, was looking for investment properties and came across 130 Thomas Street online. In March 2014, he bought the house for €125,000.

"It was a bit of a rush buy because it was at auction," Sinnott says. "I thought I'd take a chance on it because I had worked on similar buildings before. But I didn't realise how old it was and what was inside."

As soon as Sinnott spotted the staircase, he called in a conservation architect, David Averill, and had wood from various parts of the house sent to Queens University in Belfast. It took four months, but the result was astonishing - the house dated back to 1639, making it the oldest intact house in Dublin today.

Brick houses were only starting to be built in Dublin by around 1620, so number 130 Thomas St is also one of the first brick houses in the capital. Before its discovery, the oldest surviving house in Dublin was at 9/9A Aungier Street, which was built 25 years later in 1664.

Aungier Street was one of many buildings that formed part of the Aungier Estate, Dublin's first planned development for Dublin's wealthy elite. A captain, Rupert Billingsley, was one of its earliest residents before the house came down in the world - owned by merchants for years before becoming a tenement building in the 1900s.

Little is known about 130 Thomas Street's history or previous owners. It was built at a time when Thomas Street, one of the oldest streets in Dublin, was on the verge of becoming a bustling centre of trade for silk and weaving. By the 1970s, the tiny shop unit was split in two, hosting a grocery store and a huckster shop. It then housed a newsagent until the 1990s, although no-one is believed to have lived in the building since the 1980s.

Resoration

You'd never know this was a 380-year-old building from the outside. "It has a horrendous facade, but it's cloaking a much older building from behind," says Hickey.

At the back, there is a triangular gable which is considered quite rare. There are also the remains of an extremely old chimneystack on the roof, with intricate brickwork which is currently being tested for age. Some historians believe it could be the oldest surviving brick above ground in Dublin.

Inside, there are very low ceilings, exposed oak beams and the distinctive staircase, which Sinnott has just completed restoring. "It's not a spectacular-looking staircase, it's very basic," he says. "The more basic they are, the older they are. But it's a nice, simple design."

Sinnott has made it his mission to restore the old house as carefully as possible, conserving all of the original elements. What he initially thought would be a relatively simple job in an ordinary building has turned into a mammoth task.

Once the house was supported with steel structures to keep it in place, everything of historical importance had to be carefully tagged and documented in conjunction with Dublin City Council.

He plans to turn the building into two one-bed apartments, with a shop unit on the ground floor, but says it will have to be something with a tourist or heritage angle. The responsibility of turning out to be the owner of Dublin's oldest house was "scary at first", he says.

"But I'm glad I bought it. If I hadn't, it would be in worse condition now," he says. "That's something that needs to be addressed across Dublin. These old buildings need to be looked after."

Hickey agrees: "We conducted a study of Dublin's early houses three years ago and we identified over 200 old houses, mostly from the 1700s. But only half of them were protected structures."

Houses from the 1600s, often known as Dutch Billy houses, had gables that were considered deeply unfashionable by Georgian times. When King George IV visited the city in 1821, there was a rush to lop off the gables to make Dublin appear more up-to-date.

As a result, many houses now appear to date from the 19th century. When Dublin's heritage listings were carried out in the 1990s, many buildings that didn't look Georgian were deemed unworthy of inclusion, but, in fact, they could be much older.

So, for now, Hickey continues seeking out Dublin's oldest buildings. "They're the hidden layer of the city's heritage that, until recently, have gone unstudied," he says. "You don't realise the quality of what we have in Dublin.

"They're all hidden and lurking behind ordinary facades."