Six Irish businessmen will receive a $635 million (€542m) payout after selling their company that developed an anti-opioid nasal spray.

Seamus Mulligan, from Waterford, and his team invested €115 million to set up Adapt Pharma four years ago, The Irish Times reports. The company focused on creating a non-injectable form of Naxalone, commonly used in hospital anesthesia.

Read More: Opioid epidemic takes hold in Massachusetts - Irish pol has a plan

The nasal-spray, branded as Narcan, came on to the US market in early 2016 just as the opioid drug crisis was declared a public health emergency.  The drug can help reverse the effects of an opioid overdose and can be used by non-medical personnel.

Narcan is now commonly used by police, health workers and even teachers in the US and Canada.

Narcan was famously used to revive singer Demi Lovato after she suffered an overdose at her Hollywood Hills home earlier this year, Evoke.ie reports.

US company Emergent Biosolutions, which specializes in public health threats, has bought the company for $635 million up front ($575 million in cash and $60 million in shares.

If Narcan hits certain sales targets by 2022, the Irish businessmen will make a further $100 million.

Read More: Irish American doctor charged with murder over opioid deaths

Mulligan, who is chairman and chief executive of the company, will stay on as a consultant when the deal is closed. His executive team will also remain with Adapt.

Along with Mulligan, chief financial officer David Brabazon, chief operations officer Eunan Maguire, chief technology officer Fintan Keegan, the company’s top US executive Michael Kelly, and company secretary James Skehan will share in the payout.