The Commission of Inquiry into the Sponsorship Program and Advertising Activities, or Gomery Commission, or Gomery Inquiry, was appointed by Paul Martin's government on 19 February 2004. Justice John Gomery of the Superior Court of Québec was the sole commissioner, appointed to investigate the misuse of funds by the federal sponsorship program.

Created by Prime Minister Jean Chrétien's government in 1996 after the near defeat of the federalist side in the 1995 Québec Referendum, the sponsorship program was designed to promote federalism in that province by advertising at community, cultural, and sporting events. Until 1999, it was managed by Chuck Guité, an official in the Department of Public Works and Government Services. Lacking sufficient staff, Guité contracted out much of the work to private advertising firms. From the program's inception until 2002, sponsorship spending was more than $40 million per annum.

In March 2002, the Globe and Mail reported that the government had paid $550,000 to Groupaction Marketing Inc for a report that no one could find. The government responded by asking Auditor General Sheila Fraser to look into its dealings with Groupaction. In May, she announced that "senior public servants broke just about every rule in the book" in awarding contracts to the firm. She referred the Groupaction files to the RCMP and began an audit of the entire sponsorship program. After temporarily suspending the program, the Chrétien government decided that future sponsorships would be allocated by public servants following new guidelines, rather than by private companies.

Upon becoming prime minister in December 2003, Paul Martin set out to distance himself from the scandal. He cancelled the sponsorship program, established new controls on government spending, and decided the government would sue various individuals and corporations that had over-billed the government. He also fired Alfonso Gagliano, Chrétien's minister of public works and the minister responsible for the program, from his new position as ambassador to Denmark. The auditor general's report was tabled in February 2004, showing that the government paid more than $100 million to communications agencies for little or no work. Martin created the Gomery Commission to look into the mismanagement of the program, saying that he was "mad as hell" and determined to see the wrongdoers punished. Despite Martin's efforts, the Liberal Party suffered a drop in popularity. In the election of June 2004, his government was reduced to a minority in the Commons.

The Gomery Commission held public hearings from 7 September 2004 to 17 June 2005, hearing from 172 witnesses. Testimony confirmed the auditor general's conclusion that advertising firms submitted invoices for work that had not been done. Witnesses also reported that companies were asked to make cash contributions to the Québec wing of the federal Liberal Party and to put Liberal workers on company payrolls. Chrétien appeared before the commission in February, defending the program as an important component of the government's efforts to raise federal visibility in Québec. He acknowledged that mistakes had been made and asserted that those who acted for personal gain should be punished through the legal system. Martin, who had been finance minister in Chrétien's cabinet, appeared a few days later, denying any involvement in the program. It was the first time in more than a century that a sitting Canadian prime minister testified before a public inquiry.

As testimony continued to damage the government's image, the opposition in Parliament pushed for an immediate election. In an effort to prevent the defeat of his government, Martin went on national television in April 2005, promising that he would call an election within 30 days of the release of the commission's final report.

Released on 1 November 2005, Gomery's first report focused on the abuse of funds in the sponsorship program. In the judge's view, Guité ran the program as he wished, awarding contracts without a competitive bidding process and encouraging over-billing and the use of fake invoices to reward Liberal-friendly firms. His direction came not from his public service bosses, but from two political masters who circumvented the normal chain of command: Public Works Minister Gagliano and Jean Pelletier, the prime minister's chief of staff. In the hearings, the two had claimed that they merely provided advice to Guité. This was "nonsense," Gomery concluded. "The expression of an opinion to a subordinate official by the prime minister's chief of staff or the minister amounts to an order."

According to Gomery's report, the Québec wing of the federal Liberal Party received illegal kickbacks from individuals involved in the sponsorship program, such as Jean Brault, president of Groupaction. The key figure was Jacques Corriveau, a senior party member who "enriched himself personally and provided funds and benefits" to the party. Gomery could not say how much money was funnelled back into the Liberal Party, because many of the donations were in cash and unrecorded. No evidence implicated either Chrétien or Pelletier in this scheme.

Although Chrétien was not directly involved in the scandal, Gomery concluded that he had to bear some of the responsibility, because the sponsorship program was run out of his office. Martin was exonerated because his role as finance minister did not involve the supervision of spending by other departments.

Martin responded to the report by promising that the Liberal Party would reimburse $1.14 million to the federal treasury and by banning ten individuals linked to the scandal, including Gagliano and Corriveau, from Liberal Party membership. These measures did not stop the further slide in support for the Liberal Party, particularly in Québec. Less than a month after the release of the first report, the opposition parties combined to topple the Martin government in the Commons and force a general election. The Liberals were defeated at the polls on 23 January 2006.

Gomery's second report was delivered to Martin on 1 February 2006, days before he stepped down as prime minister. The report contained recommendations on ways to restructure government to prevent the misuse of public funds. These proposals included the provision of more power and funding to parliamentary committees to allow better oversight of government spending, limitations on the influence of political aides, and a requirement that public servants document their recommendations and decisions. The incoming prime minister, Conservative Party leader Stephen Harper, had campaigned on his own set of proposals to tighten government spending controls. He praised the report but stopped short of promising that his government would implement the recommendations.

Meanwhile, Chrétien and Pelletier began legal proceedings to clear their names. In June 2008, the Federal Court ruled that Gomery had displayed bias in several comments made before the hearings had closed and that his remarks showed that he had prejudged the issues. According to the court, Gomery had insulted Chrétien when he described the distribution of golf balls bearing the prime minister's signature as "small-town cheap." The court voided those sections of Gomery's report dealing with Chrétien and Pelletier.