Prime Minister David Cameron has bowed to pressure to enshrine in law the state's duty to look after the welfare of the armed forces and their families.
He said the military covenant would be put on a statutory footing for the first time.
Defence Secretary Liam Fox will give details of the move to MPs on Monday, publishing a new Tri-Service Covenant which sets out rights to services such as health, housing and education for forces' children.
Amendments to the Armed Forces Bill will incorporate the principles of the covenant. The legislation originally included only an annual review of how the informal agreement was being met - leading to accusations Mr Cameron had broken a pre-election pledge to make it law.
A campaign led by the Royal British Legion was joined by Labour and a Tory backbencher had raised the prospect of a damaging Commons revolt by tabling his own bid for formal legal recognition.
Signalling the change of direction Mr Cameron said: "The high esteem we all have for our armed forces will soon be given the recognition it deserves - as part of the law of the land."
Writing in the News of the World, which has campaigned on the issue, he said: "I'm keeping my word. We owe them. If we are asking our armed forces to do dangerous jobs in places like Afghanistan and Iraq, we have to ensure that we are doing everything we can for them in return.
"The historic agreement we have reached means that, for the first time, the value we place on those brave men and women who put their lives on the line will be written down for all to see."
The Bill will make clear that no-one should be disadvantaged because of their military service and, beyond that, that special treatment could sometimes be justified.
Ministers have been wary of the prospect of facing court challenges over failures if the legitimate expectations were made explicit on the statute book. But the controversy has served to highlight concerns that military personnel are failing to be provided with the level of service they are entitled to in areas such as health, housing and pay.