Ahsan Iqbal, 59, was shot in the right arm as he prepared to leave a public meeting in his constituency in Punjab province late Sunday.
A man identified by police only as "Abid" and said to be in his early 20s was wrestled to the ground by officers and bystanders as he was preparing to fire a second shot. He has been taken into custody.
Police are still investigating the attack, but local deputy commissioner Ali Anan Qamar told AFP that the shooter said he was inspired by a controversy last year in which a small amendment to the oath that election candidates must swear had to be hastily reversed after it was linked to blasphemy.
The row sparked a three-week sit-in last November by a previously little-known Islamist group, which paralysed the capital.
That demonstration ended when the government capitulated to the protesters' demands -- including the ousting of the federal law minister -- in a deal brokered by the military.
At the time many Pakistanis and analysts warned that a dangerous precedent had been set in which fringe groups could bend the state to their will by citing blasphemy, a highly inflammatory charge in the conservative Muslim country.
Iqbal, a champion of Pakistan's much-persecuted religious minorities, pushed for a negotiated settlement to the controversy. He has previously condemned hate speech against groups such as the Ahmadis, an Islamic minority sect who were at the centre of the dispute.
After the shooting he was rushed first to a local hospital and then airlifted to Lahore, where video footage released by his ruling Pakistan Muslim League-Nawaz party (PML-N) showed him being lowered from a helicopter on a stretcher, his eyes open as he responded to questions.
Doctors performed surgery on him until the early hours, Shafqat Waseem Chaudhry, one of the five-member medical team responsible for him, told AFP.
"He is stable now. But he will remain in the (intensive care unit) for two days," he said.
The attack was swiftly condemned by the international community as Pakistanis voiced fears it represented an attempt to weaken democracy ahead of the federal elections, widely expected to be held late this summer.
Ziauddin Yousafzai, the father of Pakistani Nobel Peace Prize winner Malala Yousafzai, tweeted that he "strongly condemned" the attack, calling it a "bad omen for upcoming general elections that is supposed to be free, fair and transparent".
"Pakistan claims that the country has returned to normalcy but such attacks continues to happen and these are downplayed," he said.
The vote will only be Pakistan's second-ever democratic transition, and with the PML-N in disarray since Prime Minister Nawaz Sharif was ousted by the Supreme Court over graft allegations last summer, there has been growing speculation it could be delayed.
The court banned Sharif from politics for life, while foreign minister Khawaja Asif was also ousted by the Islamabad High Court late last month for violating election laws.
Sharif and his supporters have repeatedly denied the allegations, suggesting they are victims of a conspiracy driven by Pakistan's powerful military to reduce the sway of their party.
Despite the setbacks, the party has won a string of recent by-elections, proving it will likely remain a force in the vote.
Blasphemy can be punishable by death under controversial Pakistani legislation, with even unproven allegations sparking mob lynchings and murders.
If the link to blasphemy is confirmed, and had the assassination succeeded, it would not have been the first political killing over the issue.
In 2011 then-Punjab governor Salman Taseer, a liberal who had called for reformation of the laws, was gunned down by his own bodyguard in broad daylight in Islamabad.
Hardliners have built a shrine to his murderer, Mumtaz Qadri, on the outskirts of the capital.
Iqbal, touted as a potential prime minister when Sharif was ousted last July, is a US-educated lawmaker from a political family long associated with the PML-N.
Considered the brains behind the party's development agenda, he previously headed up the planning ministry.
(Except for the headline, this story has not been edited by NDTV staff and is published from a syndicated feed.)