Was he flirting with me?

I have this guy friend in my class. I've known him for a while now. We've gotten pretty close, we talk about family, our problems and all of that stuff. There were moments where we would talk about deep stuff when it comes to life and etc. But something happened today when he invited me to work on an assignment with him. We were on the verge of joking and just playing around but on the midst of that he said "Oh crap I almost made a dirty joke" and my curious self was like "Wait huh- what was the joke?" And he proceeded to say that he wasn't like that and just moved on. Only now I realized he never made a dirty joke before and I asked my friends what was the deal about him and they said He was flirting with me and proceeded to tease me about it. I don't really think I can trust them with the answer since they joke around a lot but I was wondering what do you guys think?

Was he flirting with me?
Post Opinion