The Egpyt star spent last season on loan in Istanbul.
He wrote on Twitter: "Yesterday was my last day in Istanbul & fans made it very emotional by the amount of love I witnessed.
"Besiktas fans: I was really touched and will always be grateful. Management & teammates: A memorable season with a superb ending by qualifying for the Champions. Thank you for everything."
Elneny will reportedly return to London Colney to start preseason training, although it is expected he will be moved on this summer.