Neither mentioned a target, but their accord came as Modi has stepped up warnings to Pakistan following a suicide attack in Kashmir that left at least 40 paramilitaries dead.
Saudi Arabia, meanwhile, constantly accuses Iran of involvement in militant strikes.
Modi again slammed the “barbaric attack” last week as he said: “To tackle this menace effectively, we agreed that there is a need to increase all possible pressure on countries supporting terrorism in any way.
“It is extremely important to eliminate the terror infrastructure and stop support to terrorists and their supporters.”
“Terrorism and extremism is a common concern for India and Saudi Arabia,” the crown prince said after talks with Modi.
“I want to state that we are ready to cooperate with India, including through intelligence sharing,” he added.
The crown prince, on his first major tour since the storm over the murder of journalist Jamal Khashoggi in October, signed joint accords with Modi on industry and culture, but announced no major deals.
In Pakistan, the Saudi prince announced $20 billion of investment for the Muslim country.
Prince Mohammed was expected to go on to China later Wednesday.