The first observation of electroweak production of same-sign W boson pairs in proton-proton collisions is reported. The data sample corresponds to an integrated luminosity of 35.9 fb−1 collected at a center-of-mass energy of 13 TeV with the CMS detector at the LHC. Events are selected by requiring exactly two leptons (electrons or muons) of the same charge, moderate missing transverse momentum, and two jets with a large rapidity separation and a large dijet mass. The observed significance of the signal is 5.5 standard deviations, where a significance of 5.7 standard deviations is expected based on the standard model. The ratio of measured event yields to that expected from the standard model at leading order is 0.90±0.22. A cross section measurement in a fiducial region is reported. Bounds are given on the structure of quartic vector boson interactions in the framework of dimension-8 effective field theory operators and on the production of doubly charged Higgs bosons.