Wilson connected with 20 of 26 passes for 282 yards to improve the Seahawks to 5-2-1 at the top of the NFC West.
Wilson connected with 20 of 26 passes for 282 yards to improve the Seahawks to 5-2-1 at the top of the NFC West before a record home crowd of 69,084 at CenturyLink Field.
But the Seattle win owed as much to a fearsome defense as Wilson's offensive prowess, with the Seahawks smothering the Bills' final drive.
A sack by Cliff Avril on third down and an incompletion into the end zone thwarted Buffalo as they chased a game-winning touchdown.
The Bills had looked to be moving into position for a decisive late score after advancing to the Seahawks 23-yard line with a drive that included a successful third-and-21 conversion.
But the drive stalled after Avril's sack and Seattle escaped with a win which extends their lead in the NFC West.
Buffalo were left ruing a lack of precision which saw them fail to take full advantage of promising field position, notably in the opening drive of the second half when Seattle's Richard Sherman intercepted in the end zone.
Buffalo closed to within three after Mike Gillislee crashed over from the one-yard line, with quarterback Tyrod Taylor scampering over for the two-point conversion to make it 28-25 early in the fourth quarter.
But Steven Hauschka's booming 49-yard field goal put Seattle up by six at 31-25 to complete the scoring.
Buffalo had earlier taken the lead after only 90 seconds of the first quarter, when Jerry Hughes' punt block handed the Bills possession on the three-yard line for Taylor to score.
Wilson then darted over from three yards to level for Seattle before the Bills regained the lead when Taylor connected with Justin Turner from five yards.
The best score of the night came from Seahawks tight end Jimmy Graham, who made a superb one-handed catch of a 17-yard pass from Wilson.
Christine Michael's close range touchdown and a further Graham take extended Seattle's lead to leave them in control.