Prime and paint the surfaces in this order:
In general, think of painting the room from top to bottom. The project go much more quickly and smoothly and cleaning up accidental drips will be easier.