BAGHDAD — The Islamic State claimed responsibility on Friday for car bombings that struck two luxury hotels in Baghdad, which a security official said had killed 14 people and wounded 25.

The bombings took place in the parking lots of the hotels around midnight Thursday amid the busy social swirl of the start of the weekend here, highlighting the ability of militants to maneuver around strict security measures. Foreigners frequently stay at the hotels.

In one attack, a bomb in a parked car hit the Cristal, which used to be called the Sheraton, in the city center, sending up a plume of black smoke and starting a fire in the middle of one of the city’s busiest areas. The hotel is a frequent spot for weddings and is next to an upscale private club.

The other attack, a suicide car bombing, hit the Babylon, a recently renovated hotel with a spa and a steak restaurant on an upper floor, which sits on the banks of the Tigris River opposite the American Embassy.