COLUMBUS, Ohio—A federal judge temporarily blocked an Ohio law banning abortions after a fetal heartbeat is detected, siding with abortion clinics that had argued the law would eliminate abortion access in the state.

The ruling Wednesday by U.S. District Judge Michael Barrett halts the July 11 enforcement of the law that opponents argued would effectively ban the procedure. That is because a fetal heartbeat can be detected as early as six weeks into pregnancy, before many women know they are pregnant.

Ohio...