US President Donald Trump holds a press conference after taking part in the UN General Assembly

US President Donald Trump said Wednesday he encouraged India and Pakistan to work out their differences in separate meetings with their prime ministers this week.

"I said, 'Fellas, work it out. Just work it out,'" Trump told a news conference after attending the UN General Assembly.

"Those are two nuclear countries. They've gotta work it out," he said.

Tensions have soared this year between India and Pakistan, which have fought three full-fledged wars, two over the divided Himalayan territory of Kashmir.

Indian Prime Minister Narendra Modi last month revoked the Muslim-majority region's autonomy and imposed a clampdown that has snapped off most internet and cellular communications to ordinary people.

Pakistani Prime Minister Imran Khan has urged the United States to take up Kashmir, but India has long refused outside mediation.

Trump showed his support on Sunday for Modi by attending a rally with him before Indian-Americans in Houston, where the Hindu nationalist leader accused Pakistan of fomenting extremism.