Now, トンネルを抜ける means "to come out of the tunnel". 雪国 is the "Snow Country" and であった is the past tense of である, the "to be" verb in its literary form (according to tangorin.com).
How と connects both these parts? What is its meaning here?
Thank you very much.