For much of its life as a country, Pakistan has been ruled either directly or indirectly by the military. The Inter-Services Intelligence (ISI) has grown to act like a state within the state, operating with absolute power and impunity—often arrogantly and shamelessly in its own interests—the country and its civilian population be damned. Yet the same firewalls, now exposed, that were erected by the army and ISI to shroud in secrecy their activities to harbor Osama bin Laden, and to make their civilian leaders appear hapless and cartoonishly stupid on the world stage, contain important silver linings in them. Taken advantage of properly by U.S. policymakers, exposed treachery could usher in a new era of transparency in Pakistan's internal affairs—much as the Watergate scandal did in America. It could transform the U.S.-Pakistan bilateral relationship from one of begrudging mistrust in the mutual need of each other into one of an openly architectured security relationship that reduces, perhaps one day even eliminates, the myriad threats emerging from Pakistani soil.

Pakistan is the global epicenter of radical Islamist ideology, its extremist practices and the terrorists it breeds. Since the country's founding in 1947, Pakistan's spy services have used extremists as a foreign-policy sledgehammer to level the playing field for the army's sub-standard performance on the battlefield. For nearly three decades before 9-11, the ISI's undeclared official support for jihadists in Kashmir brought Pakistan to the brink of nuclear war thrice with India. And for the past decade since 9-11, bin Laden's al Qaeda legions (ensconced in Pakistan's urban centers), Sirajuddin Haqqani's terrorist network (interspersed along the Afghan-Pakistan border in Waziristan) and Mullah Omar's caliphate (reorganizing the second coming of Talibanism from Pakistani soil) have all served the ISI's foreign-policy interests to reassert its control over Afghanistan—control that was lost to NATO, to a rising India and to America's armed forces in the aftermath of the 9-11 attacks.

In the days since bin Laden's death, Pakistan's response has demonstrated its guilt and complicity. Yet this need not be the case. Bluster, arrogance and dissimulation—all very high on the list of character traits in Pakistani leadership—need to be replaced with equal measures of humility, candor and calibrated actions that remedy the lies.

President Asif Ali Zardari, a shrewd politician even if always self-interested, has a narrow window in which he can potentially end the army's rogue operations and get control over his spies. He should instruct Chief of Army Staff Gen. Ashfaq Kayani and ISI Director-General Shuja Pasha that in order to compensate for Pakistan's complicity in sheltering bin Laden, they are to locate Mullah Omar, Ayman Al-Zawahiri, Sirajuddin Haqqani and other high-value targets and hand them over to U.S. Special Forces in five days. If they do not, he should tell them he will permit any U.S. military operation on Pakistani soil or in its airspace that rids Pakistan of the terror masters, and then fire both generals.

Zardari should then move up the timetable for President Barack Obama's planned visit to Pakistan this year. The U.S. president should make his case for sustained, broad-based and textural engagement not from the Oval Office or on the stump in anytown America, but from Pakistani soil so he can help rebuild confidence in its people that America is not a fair weather friend. In this darkest hour of Pakistan's humiliation, an American president coming face-to-face with the very people who burn him in effigy could have a dramatic turnaround effect in rehabilitating the psychology of a nation whose own leaders are as incompetent to rule as they are venal and corrupt.

Obama should meet Pakistan's people as widely and as often as he can while there. But he should meet the army and intelligence chiefs privately—so as to not humiliate them further in public—and lay down the law about granting further American taxpayer support to Pakistan. He should tell them if they want more money to sustain counterterrorism operations, they need to give him a plan that, for example, transforms radicalized madrassahs into schools of higher learning that are open to both girls and boys within three years (in time for the next elections), and then he should tell them he will not allow that they accept Saudi patronage of madrassahs any longer. The money required to purchase one F-16 funds an entire province's education budget for six months.

He should then ask the army to prepare a plan that puts al Qaeda sympathizers to work building roads, bridges, hospitals and irrigation systems that raise up farmlands—in short, anything that is gainful employment—and put American money to work behind that army-backed revitalization plan. People with jobs don't have time to throw stones or build bodysuit bombs.

After nearly $20 billion in aid over the past 10 years, and with $3 billion more slated to come in this year, America needs to force Pakistan to disburse U.S. money down to the right layers of civil society. Pakistanis don't hate Americans, they hate the American government for letting all that money go into the wrong places and never doing anything about it. They see us as a moral nation that allows immoral acts in Pakistan's backyard to be done with money that we claimed was destined to help them. In essence, they see us as hypocrites. They are right. We need to fix our own messy aid-giving paradigms.

Obama should then tell the military and intelligence chiefs that the U.S. will have no choice but to violate Pakistan's sovereignty at every future opportunity it gets until Pakistan is ready to come clean on its malfeasance and stop using terrorists as a key instrument of its failing foreign policy. America can never again be held hostage to the lies and deceit of Pakistan's military men, whose agendas are nefarious and whose vision of the world is limited to brinkmanship in their own backyard.

Obama might end the meeting by reminding the generals that he knows precisely why his stealth helicopters really bothered them, whether they knew the U.S. airships were coming or not. They demonstrated critical weaknesses in Pakistan's air defense and rapid response systems that, with glee, the Indians were paying great attention to. He might then drop a hint that he could either quietly lay an arm on the Indians to keep away, or stand aside and let them have at the Pakistanis.

Pakistan is an important country and a critical ally. In everything it does, it behaves badly and then rattles its nuclear saber or terrorist-hunter credentials to bail itself out. This time, the magnitude of humiliation it has suffered after being caught red-handed may just be enough medicine to change its behavior as a nation. But American engagement in the right ways is crucial to achieving a good result. The other option—a failed terrorist state with nuclear weapons -- is not an option unless Washington is planning an array of special operations to destroy everything in that country.

Mansoor Ijaz, an American of Pakistani ancestry, is chairman of Zurich-based Aquarius Global Partners, a venture investment firm. Previously, as a private citizen, Ijaz negotiated Sudan's offer of counterterrorism assistance on Osama bin Laden and other radical groups to the Clinton administration, FBI and CIA in 1997 and was the joint author of the blueprint for a ceasefire of hostilities in Kashmir between Indian security forces and Kashmiri militants in the summer of 2000.