LAHORE, Pakistan — Imran Khan, the charismatic cricket star-turned-opposition-leader, is brimming with newfound confidence.

With general elections expected in July, Mr. Khan made a spirited claim to lead the next government when he addressed thousands of his supporters who had gathered in the politically important city of Lahore a week ago. The rally kicked off the election season, and other political parties have begun campaigning around the country.

Mr. Khan — a populist with whose nationalist appeal rests in part on an anti-American platform — is the main challenger to the political party of former Prime Minister Nawaz Sharif, who was ousted last year by the Supreme Court after a corruption inquiry. Mr. Sharif was barred from holding public office, and he faces a verdict next month on corruption charges.

With Mr. Sharif looking at possible jail time, and several leaders of his party, the Pakistan Muslim League-Nawaz, ensnared in corruption investigations, Mr. Khan says his time has arrived. He presents himself as an alternative to what he calls a corrupt political elite, and says he will work to improve education, health and the environment.