Butt Sex & Condoms

What happens if you have anal sex with a condom? Can you still get an Std or something, my S/O and I aren't sure. & Also, is it painful?