Boris Johnson assured Sir James Dyson his employees would not have to pay extra tax if they came to the UK to make ventilators during the pandemic.
Sir James, whose firm is now based in Singapore, wrote to the Treasury to ask for no change in tax status for staff.
But in text messages sent in March 2020 - seen by the BBC - Sir James then went directly to the PM, with Mr Johnson replying: "I will fix it."
The government said it did everything it could to get the right equipment.
And Sir James said it was "absurd to suggest that the urgent correspondence was anything other than seeking compliance with rules" and that his company did not receive "any benefit from the project".
Labour called the revelations "jaw-dropping", with shadow business minister Lucy Powell telling the BBC: "Frankly it stinks that a billionaire businessman can text the prime minister and get an immediate response and, apparently, an immediate change in policy."
In the exchanges, the PM messaged Sir James saying: "[Chancellor] Rishi [Sunak] says it is fixed!! We need you here."
When the businessman sought further reassurance for the tax status of the firm and "senior individuals", the prime minister replied: "I am First Lord of the Treasury and you can take it that we are backing you to do what you need."
Two weeks later, Mr Sunak told a group of MPs that the tax status of people who came to the UK to provide specific help during the pandemic would not be affected.
The company later shared the texts with officials, but it is not clear if Mr Johnson flagged the exchanges with officials as the rules suggest he should.
The messages have come to light amid an ongoing row over lobbying in Westminster.
According to the ministerial code - a list of rules setting out the standards of conduct expected of ministers - "a private secretary or official should be present for all discussions relating to government business".
And if a minister "finds themselves discussing official business without an official present" - such as at a social event or on holiday - "any significant content should be passed back to the department as soon as possible after the event".
The code also says ministers "must act and take decisions impartially, fairly and on merit, using the best evidence and without discrimination or bias" and that they should "act and take decisions in an open and transparent manner".
But there is widespread concern about informal contacts and lobbying between government and business after the revelations that former Prime Minister David Cameron sent texts to the chancellor and other ministers on behalf of the failed finance firm Greensill Capital.
A number of inquiries are being carried out in light of the affair, including by No 10 itself and Commons select committees.
Lobbying can be absolutely legitimate. It's part of how Westminster lives and breathes. Who would object to a small charity approaching its local MP to ask for help?
There are thousands of different circumstances in which having those discussions is perfectly valid.
Sir James was trying to respond to the urgent call for help at the start of the pandemic, when there was deep and genuine fear that the NHS simply wouldn't have the equipment to look after many thousands of patients at risk.
But Dyson also, understandably perhaps, wanted to be clear about protecting its business from any extra costs or liabilities. (In the end remember, they lost money from the project.)
And the prime minister was heavily involved in efforts to get hold of ventilators and in touch with many businesses as the pandemic took hold.
But the rules that govern ministers' behaviour aren't just about what is being discussed, they are about how the conversations are had.
When coronavirus hit the UK in March 2020, the government put out a call to businesses to take part in a "national effort" to increase the number of ventilators in the country.
At the time, the Department of Health feared the NHS could need as many as 20,000 additional ventilators on top of the 5,000 it had - along with an existing 900 to treat children.
The prime minister is understood to have called Sir James on 13 March and asked him to participate.
Dyson answered the call and said it spent £20m on developing its own design - though subsequently the company was not called upon to provide ventilators to the NHS.
But the BBC has discovered that Sir James also raised his concerns with the Treasury, and later the prime minister, about rules that could see staff brought into the UK for the project needing to pay tax.
Dyson's holding company, Weybourne Limited, wrote an official letter to the chancellor on 15 March 2020 asking him to make sure that HMRC would not change the tax status of companies or individuals who came to the UK to take part in the ventilator project.
In the letter, it said: "Dyson businesses are redeploying resource so that the nation's requirement for medical equipment can be met in the very near term during this period of the national emergency.
"The bulk of this work will be carried out in the UK and will require us to reassign senior individuals currently based outside the UK to work in this country."
It added: "In this context we would be grateful for your confirmation that HMRC will be instructed not to take points against individual and corporate taxpayers that would otherwise affect their tax positions whilst deployed in the UK."
Dyson also said the measure "should be publicised and should apply to all persons in the UK (such as non-resident health workers) who are working in the national interest".
When the Treasury did not reply to letter, Sir James raised the issue with Mr Johnson directly via text messages over the subsequent days.
On 26 March 2020, the prime minister told Sir James: "You can take it we are backing you to do what you need."
On 9 April, Mr Sunak confirmed to the Treasury Select Committee that the tax status of people who came to the country for Covid-related projects would not be affected.
Responding to the exchange, a government spokeswoman told the BBC: "At the height of the pandemic, there were genuine fears that we would quickly run out of ventilators, leaving the NHS unable to treat patients and putting many lives at risk.
"As the public would expect, we did everything we could in extraordinary times to protect our citizens and get access to the right medical equipment."
Sir James said he was "hugely proud" of his firm's response in "the midst of a national emergency", and he would "do the same again if asked".
He added: "When the prime minister rang me to ask Dyson to urgently build ventilators, of course I said yes.
"Our ventilator cost Dyson £20m, freely given to the national cause, and it is absurd to suggest that the urgent correspondence was anything other than seeking compliance with rules, as 450 Dyson people - in UK and Singapore - worked around the clock, seven days a week to build potentially life-saving equipment at a time of dire need.
"Mercifully they were not required as medical understanding of the virus evolved. Neither Weybourne nor Dyson received any benefit from the project, indeed commercial projects were delayed, and Dyson voluntarily covered the £20m of development costs."
Sir James also said his company had not claimed "one penny" from governments in any jurisdiction, in relation to Covid.
For Labour, Ms Powell said: "It seems that this country only works for people who are rich enough and, frankly, donors to the Tory party, who have got the personal phone numbers of the chancellor or the prime minister."
But former Labour Prime Minister Tony Blair told BBC Radio 4's Today programme he found it "hard to get worked up" about the contact between Mr Johnson and Sir James, as it had happened "in the middle of a pandemic".
The government had been "asking James Dyson to start making ventilators", he added, saying: "There's got to be a certain degree of understanding if we are in the middle of a huge crisis like this."
Culture Secretary Oliver Dowden told BBC Breakfast: "In the middle of a national emergency, we had to move fast...that's what the prime minister did in this instance."
He added: "This went through Parliament in a transparent way. There was an opportunity for MPs to be able to vote on it. And it was indeed a very temporary measure."
What are the tax rules?
Broadly speaking, if you live and work in the UK or if your company is based here, then you have to pay taxes on what you earn to the government.
But, if you do not live in the UK and your business is based abroad, you can only work here for a certain number of days before you and/or your company faces a tax bill.
The system is known as the statutory residence test or SRT.
For an individual who works abroad full-time, the limit is usually 90 days.
However, during the pandemic, the government changed the rules so that days spent in the UK between 1 March 2020 and 1 June 2020 would not count in the 90 day tally if they were spent working on Covid projects - such as ventilators.
Who is Sir James Dyson?
Sir James Dyson is a British inventor who rose to fame with his bagless vacuum cleaner creation.
His Ballbarrow invention became his first success - but after years of his vacuum design being turned down by manufacturers, he went out on his own to set up Dyson Limited.
By the early 2000s, the product was a market leader and the company branched out into a range of new items, from fans to hand dryers.
Sir James was knighted in the 2007 New Years Honours List and he regularly sits on The Times' UK Rich List- with his net worth estimated to be £16.2bn in 2020.
During the EU referendum, he was a vocal supporter of Brexit.
In January 2019, he announced he was moving his company headquarters from Malmesbury in Wiltshire to Singapore.