The detainees are members of the same family and both from the West Bank town of Beit Kahil i teh Hebron area – Nazir Salah Khalil Atsafra, a 24-year-old Hamas activist, and Kassem Araf Khalil Atsafra, aged 30.
The two are considered the main suspects in the murder of the 18-year-old earlier this week. Two other people suspected of aiding them have also been detained.
The Israel Defense Forces said in a statement that terrorists who killed the 18-year-old outside a settlement near Hebron were arrested and the car they used in the attack was seized.
There was no immediate Palestinian comment.
The body of Sorek was found with stab wounds near his yeshiva (religious seminary) at Kibbutz Migdal Oz, where he studied as part of a program combining military conscription with religious classes. He was neither in army uniform nor armed.
Prime Minister Benjamin Netanyahu praised intelligence and security forces for locating and arresting the suspects.
"We will continue to fight terrorism intensely on all fronts," he wrote on his Twitter account.
Hamas, the terrorist group controlling the Gaza Strip, accused the Palestinian Authority, its rival in the West Bank, of cooperating with Israel to identify the terrorists behind the killing.
"We have always warned against the security liaison between the Authority's security in the West Bank and the occupation army," Hamas spokesman Hazem Qassem said.