He was born on 25 October 1944 in Pind Malikan (now Mahfuzabad), Rawalpindi district. He was enlisted in the Army on 25 October 1962. Serving in A Company of 15 Punjab Regiment when war broke out in 1971, Lance Naik Muhammad Mahfuz was deployed on the Wagha-Attari Sector where his company was pinned down by unceasing frontal and crossfire from automatic weapons. Although his machine gun was destroyed by an enemy shell, Muhammad Mahfuz advanced towards an enemy bunker whose automatic fire had inflicted heavy casualties. Even though wounded in both legs by shell splinters, when he reached the bunker he stood up and pounced on the enemy, in the encounter he was hit with a bayonet. Although unarmed, he got hold of the enemy and did another bayonet strangling with him. Due to serious injuries he embraced martyrdom on the night of 17 December 1971.