The Government has passed the Overseas Operations (Service Personnel and Veterans) Act through Parliament.
Known until now as the Overseas Operations Bill, the major aim of the legislation has been to limit false and historical allegations against personnel and veterans.
It has now gained Royal Assent and will come into effect following the opening of the new Parliament.
The Government says the legislation will give personnel stronger legal protections from the threat of repeated investigations and prosecution.
The new act introduces measures in two parts – part one, which covers criminal allegations, with a 'triple lock' to ensure the context of overseas operations is considered when deciding whether to prosecute, and part two, which prevents civil claims from being brought six years after an incident is alleged to have taken place.
Earlier this week, the Government agreed to exclude war crimes from the legal safeguards for personnel in the legislation.
It followed a move by ministers last week to ensure genocide, crimes against humanity and torture were also excluded from future legal protections for servicemen and women.
While not an absolute ban on historical prosecutions, one of the key aims of the Overseas Operations Bill has been to introduce a statutory presumption against prosecution, making it exceptional for personnel to be prosecuted for some offences five years or more after an incident.
Following the Overseas Operations (Service Personnel and Veterans) Act being passed by Parliament, Minister for Defence People and Veterans Leo Docherty said: "This is a landmark moment in defence as the Overseas Operation Bill achieves Royal Assent and I am proud to deliver on our manifesto commitment.
"For too long, our brave service personnel and veterans have been subject to unfounded allegations after serving honourably and this legislation will give them the protection they need.
"I hope today's announcement provides those who have served, and their families, with the reassurance they so richly deserve."
Mr Docherty, himself a military veteran, succeeded Johnny Mercer as Minister for Defence People and Veterans last week.
Mr Mercer told Boris Johnson he had "no choice" but to leave the role, over the lack of legal protection for UK veterans of the Troubles.
The Government has since said a new law to protect veterans who served in Northern Ireland will "soon" be brought forward.