Sweden is not a NATO member but has close relations with NATO, and regularly discusses joining. They've bought and sold arms to NATO countries, and Russia is a concern for NATO and Sweden. I'm relatively certain that they've been in close contact with the U.S. about this and would know if it was an American sub.