A month after President Obama appointed tech mogul Ranvir Trehan a trustee of the prestigious Kennedy Center for the Performing Arts, Trehan wrote a $100,000 check to benefit Obama’s presidential library.

The March-dated donation from the Trehan Foundation, based at the philanthropist’s sprawling home in Virginia, followed the White House’s February announcement that Trehan would take a seat on the Kennedy Center’s board beside such bigwigs as retired Boeing chairman W. James McNerney Jr. and “Grey’s Anatomy” and “Scandal” producer Shonda Rhimes.

But Trehan’s foundation made a mistake. It sent the check to the Barack H. Obama Foundation, a small Virginia charity named after Obama’s father that is run by Obama’s Kenyan half-brother, Malik.

The foundation raising money for the Obama library in Chicago is the Barack Obama Foundation.

Malik Obama told The Post he returned the check to the Trehan Foundation. “Nobody thanked me,” he added.

Trehan, 75, who immigrated to the United States from India in 1964, told The Post his assistant made the mistake.

“I did write a check to the Obama Foundation because somebody mentioned to me that there was a foundation for his library or something,” he said.

Trehan said he had long been active with the Kennedy Center but did not know how he came to be appointed to its board.

He said when the White House called him last winter to tell him about the plum gig, he was “thrilled” and asked whom he should thank.

“We don’t share that with you. You should just remember that the president has nominated you for this,” he said the White House told him.

Asked if the $100,000 was a thank-you to Obama, he said, “It’s a reflection of my belief in what he stands for.”

“It’s a thank-you in my mind,” he added.

He insisted the White House did not solicit the donation.

Oddly, after his check was returned, Trehan decided not to give the money. He said he preferred to wait until plans for the library were more developed.

Like many members of the Kennedy Center board, Trehan is a big Democratic donor. He gave $33,100 to Obama’s campaigns and has also contributed $121,600 to the Democratic National Committee.

He founded the SETA Corp., an information technology services company in McLean, Va., in 1987. In 2005, Apptis Holdings bought the company, which had $86 million in annual revenue at the time. Trehan was Apptis vice chairman until 2011.

He is one of 36 presidential appointees on the Kennedy Center board.