A key prosecution witness testified Tuesday that Internet company Livedoor Co. doctored its earnings by selling and buying its own stock, as the trial of its former president, Takafumi Horie, entered its second day.

Hiroshi Onishi, president of an investment fund, said he was ordered on several occasions by a Livedoor executive to sell shares in the company to other firms he suspected were affiliated with Livedoor.

"I thought that they wanted to window-dress their earnings," Onishi told the court, adding that he followed through on what he considered irregular trading practices partly because of the large commissions he stood to earn.