Apple executives defended the company's tax strategy on Capitol Hill Tuesday, claiming that it pays one of the highest effective tax rates of any major corporation.

A Senate panel called the hearing to examine what committee leadership said was the iPhone maker's strategy of shifting income to an Irish subsidiary to avoid paying U.S. taxes. Apple officials said the money resided with its overseas operations, such as those in Ireland, not to avoid taxes but because of the growth of Apple's sales overseas.

Apple (AAPL) CEO Tim Cook said the company paid an effective tax rate of 30.5% on profits it made on U.S. sales. He said Apple paid $6 billion in U.S. corporate taxes last year and expects to pay more this year.

"I'm often asked if Apple still considers itself an American company," Cook said. "My answer always has been an emphatic "Yes.' We are proud to be an American company, and equally proud of our contributions to the U.S. economy."

He said Apple has never considered moving its headquarters out of the United States.

"It's beyond my imagination, and I have a pretty wild imagination," Cook said in response to a question.

Related: Apple - What it's like to drown in cash

Democratic Senator Carl Levin, chairman of the Senate's Permanent Subcommittee on Investigations, and John McCain, the panel's top Republican, both started the hearing with withering criticism of Apple's practice of shifting income to Ireland to avoid paying U.S. taxes.

Levin called the practice a "sham," while McCain said that Apple's claim that its use of the Irish subsidiary did not reduce its U.S. taxes is "demonstrably false."

"U.S. corporations cannot continue to avoid paying their appropriate share in taxes," said McCain. "Our military can't afford it. Our economy cannot endure it. And the American people will not tolerate it."

Related: Tim Cook has some explaining to do

McCain asked Cook: "Can you see there's a perception of an unfair advantage here?"

"Honestly speaking, I don't see it as being unfair," Cook replied. "I'm not an unfair person. That's not who we are as a company."

Cook said Apple strongly supports corporate tax reform and that it was happy to testify at the hearing if it would advance the chance of such reform being passed, even if it raised Apple's own tax bill.

The comments came on top of a report released Monday by Levin and McCain detailing Apple's tax strategy.

Apple has $144 billion in cash. But more than $100 billion of that is overseas. If Apple were to try to bring that cash back to the United States, it could be taxed at the top corporate tax rate of 35%.

Apple did garner support from one corner: Sen. Rand Paul of Kentucky, who said he was offended by the hearing.

"Tell me one of the politicians up here who doesn't minimize their taxes. Tell me a chief financial officer you would hire if he didn't try to minimize taxes legally. Tell me what Apple has done that is illegal," said Paul. He said that Congress should apologize to Apple for calling it before the committee, and for a tax system that is "bizarre and Byzantine."

"Money goes where it's welcomed," Paul said. "Currently our tax code makes money not welcomed in this country."

Related: Individual investors rush into Apple

Levin struck back at Paul, saying the committee was doing nothing wrong looking at the issue of offshore tax havens and Apple's tax practices.

"Apple is a great company, but no company should be able to determine how much it's going to pay in taxes...using all kinds of gimmicks to avoid paying the taxes that should be paid to this country," Levin said. "The people know it's not right."

Even the critics of Apple at the hearing did not claim that it was doing anything illegal with its tax strategy, they were only saying that the way the current tax system is now set up was bad policy.

"Everyone agrees, apparently, (that) we have to change the system," Levin said. "How we do it, we may not agree to."

The other area of widespread agreement at the hearing was praise for Apple products, particularly the iPhone.

But McCain got laughs when he told Cook, "What I really wanted to ask you is why I have to keep updating the apps on my iPhone all the time, and why you don't fix that."

Cook responded that they were trying to make the products better all the time.