Tim Cook became Apple’s chief executive in 2011 after the death of co-founder Steve Jobs. (Eric Risberg/AP)

Apple chief executive Tim Cook went to Capitol Hill on Tuesday to defend the tech giant against accusations that it is using gimmicks to pay less than its fair share of taxes.

In prepared testimony before the Senate’s Permanent Subcommittee on Investigations, which Apple released Monday night, Cook strongly denied that the company uses any improper methods to reduce its taxes, saying that the subsidiaries that Apple has set up in Ireland help the U.S. economy by improving its position in Asia and Europe.

Cook was joined at the hearing by Apple chief financial officer Peter Oppenheimer and Phillip Bullock, head of tax operations, as the three responded to senators complaints that the company is using a “complex web” of offshore entities to exploit loopholes in tax law and shelter overseas profits from U.S. taxes.

Though Apple was the subject of Tuesday’s hearing, several companies use similar offshore tax strategies, The Washington Post reported, and it’s particularly easy for technology companies to shift assets, including intellectual property, to other territories with lower taxes. In Apple’s case, the firm set up two subsidiaries in Ireland to hold foreign earnings, The Post reported, despite the fact those Apple units have no employees in the country.

Ahead of Cook’s testimony, lawmakers were divided on Apple’s actions. Committee chairman Sen. Carl Levin (D-Mich.) accused the company of shifting $36 billion in taxable sales income out of the United States in 2012. Sen. John McCain (R-Ariz.) called Apple one of the “biggest tax avoiders” in the country.

But Sen. Rand Paul (R-Ky.) opened the hearing with a fiery speech, saying that the committee owes Apple an apology for “dragging” Cook and other Apple executives to Washington when they haven’t done anything illegal. Rand proposed lowering the corporate tax rate to 5 percent to encourage companies to bring operations back to the United States.

More on Apple’s taxes:

Apple avoids taxes with ‘complex web’ of offshore entities, Senate inquiry finds