But as he tries to shape a new identity, his past looms large.

He not only came of age under the wings of some of the most controversial warlords associated with the past decades of the Afghan war, but he is also accused of having acted much like them when he became a young governor. Human rights organizations say that when Mr. Khalid ran the provinces of Ghazni and then Kandahar, he maintained private prisons where forces under his command tortured detainees.

Mr. Khalid has long denied those accusations.

“In the provinces, the governor is the overall in charge,” Mr. Khalid said. “If you have the police prison, and the police forces are your guards, what is the need for private prisons?”

In Afghanistan’s deteriorating security environment, where a resurgent Taliban is engineering deadly bombing attacks seemingly daily, politics is often a deadly business. Mr. Khalid’s opening rally, and its preparations, had the secrecy of an intelligence operation and the color and chaos of a summer camp.

He kept his program so under wraps that even the thousands of young people who arrived from more than a dozen provinces did not know where the Aug. 2 rally would be held until the last minute. He was preoccupied with security — trying to keep the rally as short as possible, and learning from recent attacks by making sure the crowd was dismissed gradually so suicide bombers wouldn’t target them on their way out the secured location.

Preparations on the eve of the rally ran late into the night at his home in Kabul, where Mr. Khalid finalized the details of the program with four other speakers. The master of ceremonies, a young man from the north, read the opening of his prepared remarks.

“Ministers, members of Parliament, excellencies,” he started.

Mr. Khalid cut him off. “There will be no excellencies, no ministers or M.P.s,” he said.