expression, suru verb (irregular)
spend a night together
Often implies sharing a bed or having a sexual encounter, but can also refer to simply staying overnight together in a non-sexual context depending on the situation.
彼らは旅先で一夜を共にした。
They spent a night together on their trip.
Compound of 一夜 (one night) + を + 共にする (to share together).