And sex doesn't have to enter into it.

When a relationship is over, the friendship can also remain.

I have friends that fit both of these conditions. Close friends...

Keep in mind that for both these conditions, sometimes 'things can happen' - that doesn't mean that was the object for establishing or maintaining the friendship though.