Defense Secretary Jim Mattis said Monday that it was time for Pakistan to get onboard with peace talks to end the war in Afghanistan.

“We are looking for every responsible nation to support peace in the sub-continent, and across this war in Afghanistan,” he told reporters before a meeting with the Indian defense minister on Monday at the Pentagon.

“It’s gone on now, its approaching 40 years; 40 years is enough. It’s time for everyone to get onboard, support the United Nations, support [Indian] Prime Minister Modi, support [Afghan] President Ghani and all those who are trying to maintain peace and make for a better world here,” he continued.

Afghans fought against a Russian occupation beginning in 1979. The war ended in 1989 — when the Taliban promptly took over — and installed fundamentalist rule and allowed the Taliban to take safe haven there. In 2001, the U.S. invaded Afghanistan after al-Qaeda leader Osama Bin Laden planned the 9/11 attacks against the U.S. from the country.

Mattis’s comments came in response to a question over whether the Defense Department has confidence in Pakistan’s willingness to help.

President Trump recently sent a letter to Pakistan Prime Minister Imran Khan asking him for his government’s help and cooperating in advancing peace talks between the Taliban and the Afghan government.

The U.S. believes Pakistan wields significant influence over an influential Taliban branch known as the Haqqani network, whose leadership is believed to have safe haven in Pakistan.

The Trump administration has doubled down on diplomatic efforts to end the war. Trump in October appointed Amb. Zalmay Khalilzad to spearhead those efforts, and he has reportedly been meeting with members of the Taliban and the Afghan and Pakistan governments.

The U.S. is trying to kickstart Afghan government-led talks, but the Taliban considers the Afghan government illegitimate and prefers to speak with the U.S. There have been no breakthroughs, according to the Washington Post.

The Taliban has insisted that U.S. troops leave the country as part of any peace deal, but the U.S. fears that once troops leave, the government will fall to the Taliban and al Qaeda will reestablish safe haven there and plot more 9/11-type attacks against the U.S.

Pakistani officials welcomed Trump’s letter.

“US President Donald Trump, in his letter addressed to Prime Minister Imran Khan, has stated that his most important regional priority was achieving a negotiated settlement of the Afghan war. In this regard, he has sought Pakistan’s support and facilitation,” the Pakistan Foreign Ministry said in a statement.

“President Trump has also acknowledged that the war had cost both USA and Pakistan. He has emphasized that Pakistan and USA should explore opportunities to work together and renew partnership. Since Pakistan has always advocated a political settlement to end war in Afghanistan, US decision is welcomed. Pakistan reiterates its commitment to play a facilitation role in good faith. Peace and stability in Afghanistan remains a shared responsibility,” it said.