NEW YORK (AP) — For years, as Donald Trump was soaring from reality TV star to the White House, his real estate empire was bankrolling big perks for some of his top executives, including apartments and luxury cars.

Now Trump’s company, the Trump Organization, is on trial for criminal tax fraud — on the hook for what prosecutors say was a 15-year scheme by his most trusted lieutenant to avoid paying taxes on those fringe benefits.

In opening statements Monday, prosecutors and defense lawyers sparred over the company’s culpability for the actions of Allen Weisselberg, who has pleaded guilty and agreed to testify as a star prosecution witness in exchange for a five-month jail sentence.

Later, another Trump Organization executive, senior vice president and controller Jeffrey McConney, walked a prosecutor through financial records, including Weisselberg's payroll forms and ledger entries showing that the company paid for Weisselberg's car leases. He will resume testifying Tuesday.

McConney, whom prosecutors say helped Weisselberg by misreporting his income to tax authorities, was granted immunity to testify last year before a grand jury and to testify again at the criminal trial. He said he appeared before the grand jury eight times on a variety of Trump-related matters.

The tax fraud case is the only criminal trial to arise from the Manhattan district attorney’s three-year investigation of the former president and is one of three active cases involving Trump or the company in New York courts.

Prosecutor Susan Hoffinger argued in her opening statement that the Trump Organization — through its subsidiaries Trump Corp. and Trump Payroll Corp. — is liable because Weisselberg, the longtime finance chief, was a “high managerial agent” entrusted to act on behalf of the company and its various entities.

The company, she said, benefited because it didn't have to pay Weisselberg and at least two other executives who received perks as much in salary and bonus pay — which for Weisselberg totaled close to $1 million a year.

The company also saved money when giving out Christmas bonuses by paying top executives as independent contractors through subsidiary companies, such as its golf courses and the ice rink it managed in Central Park, Hoffinger said.

“This case is about greed and cheating — cheating on taxes," Hoffinger told jurors. "(The Trump Organization) paid their already highly paid executives even more by helping them cheat on taxes.”

A Trump Organization lawyer, Michael van der Veen, countered that the Weisselberg had gone rogue and betrayed the company’s trust. Weisselberg concocted the scheme without Trump or the Trump family’s knowledge, cheated on his personal income taxes and lied to the company about what he'd done, van der Veen said.

“This case is about individual, personal greed and the abuse of trust necessary to feed that greed. Allen Weisselberg is a man who has fallen to that greed,” van der Veen said.

“Weisselberg did it for Weisselberg," he said.

Weisselberg has pleaded guilty to taking $1.7 million in off-the-books compensation. His Manhattan apartment, Mercedes-Benz cars for him and his wife, and his grandchildren's school tuition were all paid for by the company. His son and another Trump Organization executive also received off-the-books compensation, prosecutors said.

When they say the Trump company, “what they really mean is Allen Weisselberg did something illegal with the intent to benefit Allen Weisselberg, his buddy or his son,” another company lawyer, Susan Necheles, told jurors.

If convicted, the Trump Organization could be fined more than $1 million and could face difficulty in securing new loans and deals. Some partners and government entities could seek to cut ties with the company. It could also hamper its ability to do business with the U.S. Secret Service, which sometimes pays the company for lodging and services while protecting Trump as a former president.

Neither Trump nor any of his children who have worked as Trump Organization executives are charged or accused of wrongdoing. Trump signed some of the checks at the center of the case, but Necheles said evidence will show he knew nothing about the scheme.

The Trump Organization is the entity through which Trump manages his many ventures, including investments in golf courses, luxury towers and other real estate, his many marketing deals and his TV pursuits.

Prosecutors have said they expect to call 15 witnesses, including Weisselberg, McConney and other Trump Organization officials. Judge Juan Manuel Merchan said he expects the trial to take at least four weeks.

Aside from the criminal case, Trump and the Trump Organization are defendants in a lawsuit brought by New York Attorney General Letitia James, who alleges that Trump and the company inflated his net worth by billions of dollars and misled banks and others for years about the value of various assets.

A hearing in that case is scheduled for Thursday.

Meanwhile, in the Bronx, jury selection was scheduled to begin Monday in a lawsuit brought by protesters who say they were roughed up by security guards outside Trump Tower. The former president gave a deposition in that case last year.