Under the deal, the 10 lawmakers from the Democratic Unionist Party (DUP) will back May's minority government over the Queen's Speech -- which sets out the legislative program -- as well as bills relating to national security and Brexit.
In return, the UK government has pledged an extra £1 billion ($1.2bn) investment over the next two years from the British government, in addition to £500 million ($600m) already committed.
"I welcome this agreement which will enable us to work together in the interest of the whole United Kingdom, give us the certainty we require as we embark on our departure from the European Union, and help us build a stronger and fairer society at home," May said in a statement.
Arlene Foster, leader of the DUP, was pictured with May at Downing Street.
The deal could act as an incentive for Northern Ireland's political parties to return to the country's Parliament after months of deadlock over the power-sharing assembly.
Northern Ireland has been without a devolved government since March when the main nationalist party, Sinn Fein, pulled out in protest over Foster's handling of a financial scandal.
A deadline of June 29 has been set for an agreement to be reached or the prospect of direct rule from Westminster could be implemented. That means the £1 billion would be distributed by London, rather than local politicians in Belfast.
"I hope the parties will look beyond their differences and come together with a shared sense of common purpose to serve all communities in the best interests of Northern Ireland," May said in a statement.
"Northern Ireland needs a functioning devolved government at this important time."
Northern Ireland's power-sharing arrangement means nationalists and unionists must work together, with the First Minister and Deputy First Minister chosen from different sides.
But the two main parties have so far failed to reach an agreement despite extensive talks.
The unstable situation at Stormont has led some critics to warn that that the deal with the DUP risks peace in Northern Ireland because it ties the UK government to one side in the peace process.
May's Conservative Party lost its parliamentary majority at the country's general election earlier this month and faced the unappealing prospect of forming a minority government.
The move will be met with huge relief in May's administration. May had faced a turbulent few weeks since suffering the setback of failing to achieve an overall majority in the election.
May called the snap election three years before legally required to do so in an effort to secure a mandate which she said would strengthen her position going into Brexit talks.
Opinion polls suggested she would win handily; but her campaign faltered, and she was left with fewer MPs than she started with. The result left May with no option but to secure a deal with a minority party in order to pass her legislative agenda through Parliament and avoid a vote of no confidence.
May's pursuit of the DUP has raised concerns across the political spectrum, even within her own party. Ruth Davidson, leader of the Conservatives in Scotland, sought assurances that LGBT rights would be protected after any deal with the DUP, which opposes same-sex marriage as well as abortion.
May under pressure
May has faced pressure on several fronts. A spate of terror attacks in the UK has stretched security services' resources, leading to questions over cuts to police budgets that she presided over when she was Home Secretary.
She has also been heavily criticized in the aftermath of the Grenfell Tower disaster, the tower block fire which killed at least 79 people.
The UK government's proposals for the rights of EU nationals after Brexit were deemed "not sufficient"
by President of the European Commission Jean-Claude Juncker.