The two Sikhs identified as Surjeet Singh and Gurvinder Singh were abducted by militants a week ago.
The spokesman from the Inter-Services Public Relations said, "The operation was conducted in a remote area along the boundary between Khyber and Aurakzai tribal regions on the basis of a tip-off from intelligence sources."
"Many militants were also killed during the operation and further details about the action would be provided soon," the spokesman said.
"The two abducted Sikhs are safe," the spokesman added.
Last week, two Sikhs Mahal Singh and Jaspal Singh were beheaded by the Taliban militants in North-West province of Pakistan.
India had condemned the brutal killing and had said that such "barbaric acts" will take "us back to the medieval times."