conjunction / conjunctive particle (colloq.)
Analysis. ところ (place, point in time or narrative) + が (but, yet) — the sense 'place' metaphorically becomes a point in discourse where an unexpected turn occurs.
Dictionary entry by Claude.
Lite mode — plain HTML for e-readers and old browsers. Full version