Two years after his election to parliament, McClelland became a member of the Opposition Shadow Ministry. He was Shadow Attorney-General 1998–2003, Shadow Minister for Workplace Relations 2001–03, Shadow Minister for Homeland Security 2003–05, Shadow Minister for Defence 2004–06 and Shadow Minister for Foreign Affairs 2006–07. In November 2007, McClelland was appointed as the Attorney-General.[2] As part of a cabinet reshuffle in December 2011 he was moved to oversee the portfolio of emergency management and housing.[3] In a further cabinet reshuffle in February 2012 following Kevin Rudd's leadership challenge, McClelland returned to the backbench.

After McClelland indicated on 8 October 2007 his party's disapproval of death sentences for all south Asian countries, his leader Kevin Rudd criticized the speech as "insensitive" because it was made on the eve of the anniversary of the Bali bombings.[4][5] McClelland apologized,[6] but critics called the positions inconsistent[7] and prevented Rudd from appointing McClelland as Foreign Minister when Labor won the 2007 election.

In the 2007 federal election, McClelland was re-elected to the seat of Barton with a 4.53% swing toward the Labor Party.[10] In the 2010 federal election, McClelland was re-elected to the seat of Barton, but suffered an 8.08% swing against the Labor Party.

In February 2008, McClelland stated that it was unacceptable that the ACT government, which proposed to allow same-sex couples to enter into civil unions, would give the right to hold public ceremonies to celebrate their unions.[11] McClelland was criticised by Greens Senator Bob Brown, who said it was displaying the ugly face of Labor conservatism.[12]
In September 2008 McClelland introduced the Same-Sex Relationships (Equal Treatment in Commonwealth Laws—General Law Reform) Bill 2008 which gave same sex couples equal rights in respect to social security, taxation and superannuation laws.[13]

McClelland has said those protesting against Australian Christian Lobby would not have recognised that the ACL had supported amendments to 84 pieces of Commonwealth legislation that removed discrimination against same-sex couples.[14]

McClelland remarked that on Polygamy in Australia "There is absolutely no way that the government will be recognising polygamist relationships. They are unlawful and they will remain as such. Under Australian law, marriage is defined as the union of a man and a woman to the exclusion of all others. Polygamous marriage necessarily offends this definition."[15]

McClelland was responsible for implementing the recommendations of the Victorian Bushfire Royal Commission including the implementation of a National Emergency Warning System.[16]

As Attorney General, McClelland undertook an extensive review of the International Arbitration Act. That review formed the basis of amendments to the Act that were introduced in 2010.[17] The Amendments gave arbitral tribunals a wider degree of flexibility in controlling arbitral proceedings and included inserting an object to emphasise the importance of international arbitration in facilitating international trade and commerce. Provisions were also introduced to require Courts applying the Act and the United Nations Commission on International Trade Law (UNCITRAL) Model Law on International Commercial Arbitration Law to have regard to the fact that arbitration is an ‘efficient, impartial, enforceable and timely’ method of dispute resolution.

McClelland also introduced amendments to federal family law, including by giving the federal family law courts jurisdiction over the financial affairs of de facto spouses.[18]