Flight instructor on training flight with student reported NMAC with another aircraft in airport traffic pattern.
Synopsis
Flight instructor on training flight with student reported NMAC with another aircraft in airport traffic pattern.
Narrative
My student and I were doing pattern work at ZZZ since pattern at ZZZ1 was full. On a previous approach while we were on final our landing clearance was cancelled and we were told to sidestep left so a jet could take off. We complied. I could tell the controller was new and was learning aircraft spacing. On our next trip in the pattern we were cleared to land just past abeam and advised of an aircraft on short final which we had in sight. Just after turning base Tower asked us to extend downwind. I told them we were already on base. As they told an aircraft on the ILS 35 to abort the approach I saw the aircraft at about 1000 ft. lateral separation and the same altitude. I immediately took controls and turned left and descended away from the other aircraft. Tower then told the other aircraft that they could continue their approach behind us if they wanted to; despite the fact that we were lower and closer to the runway at this point and separation was not adequate. The other aircraft went missed and my student and I received an updated landing clearance and landed. After this incident we departed the pattern and ZZZ and went directly back to ZZZ1 and landed full stop. Both aircraft took immediate action to avoid the other as soon as the risk was identified. ATC sequencing was insufficient and instructions were unspecific for both aircraft in regards to other traffic to look for.
Source: NASA Aviation Safety Reporting System (public domain). Reports are voluntary submissions and are not verified by NASA.