The surprise announcement came just as Labour leader Sir Keir Starmer briefed reporters on his party's own plans to ban MPs' outside employment.
It follows weeks of political pressure amid a row over former Tory MP Owen Paterson, who broke lobbying rules.
The PM said a ban would stop MPs from "exploiting their positions".
The debate over MPs' jobs outside of Parliament has intensified since Mr Paterson was found to have used his position to lobby for two firms paying him.
He resigned as an MP earlier this month, after the government U-turned on a bid to block his suspension and to overhaul the disciplinary process for MPs.
At a press conference, Sir Keir said his party would ban all second jobs if it got into power, apart from "public service" roles or professions requiring registration.
The Labour leader said these included MPs working as NHS doctors and nurses, or in the police and as Army reservists.
But he said work he had done in providing legal advice alongside being an MP - but before becoming leader - would no longer be allowed.
Sir Keir had called the press conference to set out his party's position ahead of a debate it had called on the outside jobs issue on Wednesday.
That debate is due to end with a binding vote specifically on banning MPs from taking paid directorships or consultancies.
Sir Keir said Mr Johnson's plan - which was announced during the Labour briefing - was a "significant victory for the Labour Party".
But he told reporters: "Be under no illusion, the prime minister has only done this U-turn because his back was against the wall."
He urged the PM to follow through on his pledge and support Labour's motion on Wednesday.
But a government source said ministers would seek to amend it - thereby giving Tory MPs a Conservative proposal to back, rather than supporting the opposition.
Labour's shadow Commons leader Thangam Debbonaire accused the government of playing "dirty tricks", and claimed it was trying to "water down" her party's plan.
She added: "We don't need warm words from the Tories but concrete steps to clear up this mess made in Downing Street."
'A matter of urgency'
The PM's proposals in his letter would implement a recommendation originally made in a 2018 report from ethics watchdog, the Committee on Standards in Public Life.
In the correspondence to Commons Speaker Sir Lindsay Hoyle, Mr Johnson said the government now wanted to see it adopted "as a matter of urgency".
"An MP's primary role is, and must be, to serve their constituents and to represent their interests in Parliament," he wrote.
He added that a ban, which it is thought would affect around 30 MPs, would ensure MPs continue to "command the confidence of the public".
He also said the government supported another recommendation in the report - to update MPs' code of conduct to state any outside roles, paid or unpaid, should not "prevent them from fully carrying out their range of duties".
Following the announcement, the Liberal Democrats confirmed their leader, Sir Ed Davey, had resigned from both of his consultancy roles.
A party spokesperson said those contracts had been ended "last week" and that while the funds earned had been "used to fund for the care for his severely disabled son", Sir Ed "has always and will always comply with all rules and standards on these matters".
The PM's proposal comes after the spotlight was shone on Tory MP and former Attorney General, Sir Geoffrey Cox, who earned over £700,000 doing legal work in the British Virgin Islands (BVI) on top of his MP salary.
Implementing both changes would require an alteration to the MPs' code of conduct, requiring a formal vote in the House of Commons.
Ouch. Politics is a harsh old business.
Sir Keir Starmer's team had decided to put him out in public to make a decisive statement, positioning him as the sleaze-buster in chief.
Yet, just as the moment arrived, even during the introduction by his deputy, Angela Rayner, someone else decided to intervene before Sir Keir was able to open his mouth.
Yes, you guessed it, one Boris Johnson.
The prime minister who a fortnight ago ordered his troops to protect one of their own who had fallen foul of the existing rules on lobbying, and defended the tradition of MPs being able to do outside work, is now proposing tighter rules and harsher penalties.
I hope you'd forgive me for gently pointing out that the timing of this change of heart is about as subtle as being smacked in the face.
But while it may have taken some of the fizz out of Labour's event, it's a pretty clear admission from No 10 that its response to the handling of sleaze allegations has been messy, and simply, as many of MPs on their own side freely worry about, not good enough, not near it.
The announcement comes as MPs agreed to formally reverse a government plan to revamp Parliament's system for investigating MPs.
Ministers had proposed the overhaul alongside a bid to block Mr Paterson's suspension for 30 days, following an inquiry by Parliament's standards commissioner.
But they abandoned the plan a day later, after an outcry from opposition MPs and some Tories.
Mr Paterson, who has always denied wrongdoing, had called the investigation into his conduct unfair.
He has also stepped back from his consultancy work, for which he was earning £100,000 a year on top of his £81,932 MP's salary.