KARACHI, Pakistan — Pakistan’s interior minister narrowly escaped an apparent assassination attempt Sunday evening when a gunman slipped into a small crowd of supporters and colleagues surrounding the minister, firing a shot that pierced his right shoulder.

The attacker was quickly apprehended and the minister, Ahsan Iqbal, taken to a hospital; government officials said he was in stable condition. The shooting, which took place in Punjab Province, left Pakistanis on edge as the country prepares to hold general elections as early as July.

Although a motive for the shooting has yet to be declared, Mr. Iqbal is a staunch supporter of Pakistan’s religious minorities, often considered heretics by the country’s radicalized offshoots of Sunni Islam. Mr. Iqbal met with religious minorities across Pakistan in recent weeks, encouraging them to go to the polls and promising to provide security to nervous constituents.

In the end, Mr. Iqbal’s own security detail couldn’t give him the protection he promised religious minorities, who are frequent victims of terrorist attacks as well as harassment and discrimination by the authorities. This past week, the minister met with Hazaras, who practice Shiite Islam, listening to their complaints of widespread discrimination at the hands of the police forces that Mr. Iqbal leads.