C172 pilot reported ATC assigned them a vector which put them into conflict with another aircraft resulting in evasive action taken.

Date: 2026-01 · Aircraft: Skyhawk 172/Cutlass 172 · Phase: cruise

Anomalies: atc-issue-all-types|conflict-nmac|deviation-altitude-excursion-from-assigned-altitude

Synopsis

C172 pilot reported ATC assigned them a vector which put them into conflict with another aircraft resulting in evasive action taken.

Narrative

Cross country lesson ZZZ1-ZZZ2-ZZZ-ZZZ1. Filed a flight plan from ZZZ2 to ZZZ and another from ZZZ back to ZZZ1. ZZZ [Approach] vectored us east of ZZZ after taking off Runway XXR; avoiding ZZZ's airspace. We were on a 185 heading at 3000' east-southeast of ZZZ when ZZZ advised us of traffic off of our left at about 9 o'clock; same altitude; and that they were no factor. They then proceeded to turn to a heading that put us on a collision course; and began oscillating between climbing and descending which confused my instructor and I as to what they were doing. Getting closer; we were unsure of what to do. Now they were uncomfortably close; and we decided to make an emergency climb (around XA:15). The Autopilot was engaged and my CFI held what she thought was CWS (Control Wheel Steering); but was accidentally transmitting to ZZZ. After realizing the mistake she let go and ZZZ told us to climb to 3500' immediately. The plane passed directly underneath us around 200-300' from our altitude; we got to 3300' when we were clear of them and descended back down to 3000' from there. We tried to get their tail number but they had disappeared off of our MFD (Multi-function Flight Display).

Source: NASA Aviation Safety Reporting System (public domain). Reports are voluntary submissions and are not verified by NASA.