James Stevenson curled home a stunning first-half free-kick as struggling Cowdenbeath recorded a 1-0 win at Raith.
The visitors dominated the first 30 minutes and almost broke the deadlock on multiple occasions as Stevenson saw a 35-yard free-kick tipped over the bar before Brian Graham twice went close with headers.
The visitors finally who got the decisive goal when Stevenson found the top corner with a stunning free-kick from 25 yards.
The home side were denied an equaliser just before the hour mark when goalkeeper Thomas Flynn pulled off a superb save to deny Grant Anderson's right-footed shot.
The Blue Brazil were inches away from doubling their lead when Greg Stewart's shot hit the post after 75 minutes but one goal was enough to end a run of six games without a win for Colin Cameron's side.