A daring plan by the Soviet navy to send in a tugboat to free the stranded submarine was averted after a race with a Swedish submarine that reached the stranded U-137 first.Despite the Soviet protestations that the boat suffered from "navigation errors", it's pretty clear that they were surveilling the Swedish base and got unlucky (or stupid). Given that the Whiskey was basically an improved WWII Type XXI German U-boat,it appears the Soviets didn't exactly send the "first string" to keep an eye on the Swedes, and they paid the diplomatic price for it.
Sweden also protested against Soviet naval forces that were grouped off its territorial waters, and feared they would try to free the submarine.
Tensions were heightened further when Prime Minister Thorbjorn Falldin gravely announced that "with all probability" U-137 was carrying atomic weapons...
...A diplomatic tug-of-war ensued with Sweden issuing sharply worded protests and demanding to interview the captain and review the logbook and charts, and Moscow refusing to allow that...
... The immediate crisis was resolved when Moscow conceded to Sweden's demands for an apology and the right to interview the captain and Besedin. On November 6, 1981 the submarine was allowed to leave Swedish waters.
Update 0116 28 Oct: The website hosting the pictures appears to be really slow right now, but there are four pages of thumbnails of the incident at this Google image search for ' W-137 submarine'. I'll try to post one of the pictures I was able to download when Blogger lets me.
Update 2302 31 Oct: After several attempts, it looks like Blogger finally let me upload the picture: