TAIPEI, Taiwan — President Ma Ying-jeou of Taiwan risked antagonizing Beijing on Friday by voicing support for protesters in Hong Kong and for greater democracy in mainland China even as he sought further free-trade agreements with the mainland.

“If mainland China can practice democracy in Hong Kong, or if mainland China itself can become more democratic, then we can shorten the psychological distance between people from the two sides of the Taiwan Strait,” Mr. Ma said in an interview at the presidential palace here.

The president’s public pronouncements on the Hong Kong protests — he also expressed support for them in a televised speech on Taiwan’s National Day, Oct. 10 — show a greater willingness lately to speak out on a delicate issue for the Chinese leadership. But Mr. Ma was quick to point out that he had issued an annual statement to mourn the Tiananmen Square crackdown in 1989, and that China had not made those statements an obstacle to improving relations.

“I think our support of Hong Kong’s democracy will not be at the expense of cross-strait relations,” he said.