RIO DE JANEIRO — Michel Temer, the deeply unpopular president of Brazil, signaled that he intends to seek a full term in October’s election, telling a newsmagazine in an interview published this weekend that “it would be cowardly not to be a candidate.”

Mr. Temer took office in mid-2016 after helping lead the impeachment of President Dilma Rousseff, for whom he served as vice president. But Mr. Temer, 77, a veteran politician of the center-right, has had a tumultuous presidency, spending much of the past year fending off criminal charges of corruption and obstruction of justice.

Winning a new term would allow Mr. Temer to maintain the special legal standing afforded to senior government officials, which has so far shielded him from trial. On two occasions last year, Congress voted to protect him from facing charges before the Supreme Court.

Mr. Temer had said as recently as last month that he did not intend to run. But in this weekend’s interview with the newsmagazine Istoé, Mr. Temer said that he came to believe that he needed to defend his legacy.