"Only if we put all these components together will we succeed," he said.
The visit by Medvedev, accompanied by FSB chief Alexander Bortnikov and Interior Minister Rashid Nurgaliyev, came a day after 12 people, including nine police officers, were killed in two blasts in the Dagestani town of Kizlyar.
On Monday, two female suicide bombers killed 39 in attacks on the Moscow subway system, which the authorities have linked to militants from the North Caucasus.
Russian Prime Minister Vladimir Putin said Wednesday it was possible the same group was behind both attacks.
Bortnikov told Thursday's conference the masterminds behind both blasts had been identified and were being sought.
"The theory that the terrorist attacks were committed by particular gangs connected with the North Caucasus has been confirmed. We personally know the masterminds of the terrorist attacks. A search operation is being conducted," Bortnikov said.
The FSB chief also said an unspecified number of people had been detained and were being interrogated.
"We will not stop and will bring this job to an end, whatever this costs us," Bortnikov said.