"Who was standing near the gate" is a relative clause, providing additional information about "The officer".