Hearts gave new manager Csaba Laszlo a winning start with a breathtaking win at Tynecastle.
Twice David Clarkson equalised for Motherwell before substitute Saulius Mikoliunas scored a stunning winner with just seven minutes left.
The home side just about deserved their win with the outstanding Michael Stewart putting them in front and Andrius Ksanavicius also on the scoresheet.
Hearts started brightly and a surging run from Laryea Kingston was not checked by the Motherwell defence but his 25-yard shot was too high.
Jamie Mole was then just inches away from connecting with an Andrew Driver cross in front of goal with Graeme Smith left exposed by his defence.
The bets early chance fell to Ksanavicius when Stephen Craigan was caught in possession but Smith was alert to the danger and spread himself to make a fine save.
Ksanavicus was then booked for diving in the penalty area after a challenge from Craigan with the Hearts' fans appealing for a penalty.
But Motherwell hit back and Hearts goalkeeper Steve Banks looked none too convincing as he came to the edge of the box to clear at the feet of Chris Porter with Motherwell players claiming he had handled the ball outside the area.
It was Hearts who made the breakthrough after 24 minutes with a well-worked goal. Stewart timed his run to perfection to chase a through ball from Driver and he drilled the ball beyond Smith from 16 yards.
Driver almost made it 2-0 with a shot that took a deflection over Smith, but the goalkeeper managed to recover to get a hand to the ball to prevent it slipping in under this crossbar.
Motherwell were level in the 33rd minute when Stephen Hughes made a great run to the bye-line before squaring it for Clarkson to apply the finish.
But Motherwell gifted Hearts the lead six minutes from the break when Mark Reynolds was shot with a header to his goalkeeper and Ksanavicius pounced to beat Smith the loose ball and poke it into the net.
Driver wasted a great chance at the start of the second half when he was sent clear by Ksanavicius, but sent the ball aimlessly across goal.
Marius Zaliukas then saw a volley well held by Smith after Motherwell failed to clear a corner.
But Clarkson equalised with ten minutes left when Juho Makela lost the ball and it broke to Clarkson who steered a low shot beyond Banks.
Hearts hit back three minutes later when Mikoliunas took a Stewart pass before crashing an unstoppable shot past Smith from the angle of the area for the winning goal.