Regional Jet 900 (CRJ900)
Flight Crew Air Transport Pilot (ATP); Flight Crew Instrument; Flight Crew Multiengine
Situational Awareness; Fatigue
Deviation - Track / Heading All Types; Deviation / Discrepancy - Procedural Published Material / Policy; Deviation / Discrepancy - Procedural Clearance; Inflight Event / Encounter CFTT / CFIT
Air Traffic Control Issued Advisory / Alert; Air Traffic Control Issued New Clearance; Flight Crew Took Evasive Action
Human Factors
On the departure from ZZZ to GDL ATC advised us to correct course immediately to avoid terrain; at this point we were well clear of all terrain in sight though admittedly South Mountain did look a bit closer than usual but I chalked that up to our heavy takeoff weight which was within limits but just. ATC then gave us a few more vectors and eventually direct ZZZZZ way point. ATC then issued us instructions to call tower for possible pilot deviation. As we checked over the FMS we realized that we had neglected to select the departure Runway XXL for the departure which put us on the wrong course. This is not an unfamiliar airport for us and we did run all checklists which means we both missed it three times.This may be a case of seeing what we want to see. I looked and saw the departure was in the box just like it was supposed to be; and only after being advised of impending doom did we really look. Fortunately; we were not unsafely close to terrain or traffic this time; but the potential it could have been is real.
Flight Crew flying CRJ-900 aircraft flew wrong departure procedure.