We present cosmological constraints using the abundance of weak-lensing shear-selected galaxy clusters in the Hyper Suprime-Cam (HSC) Subaru Strategic Program. The clusters are selected on the aperture-mass maps constructed using the three-year (Y3) weak-lensing data with an area of ≈500deg 2, resulting in a sample size of 129 clusters with high signal-to-noise ratios ν≥4.7. Owing to the deep, wide-field, and uniform imaging of the HSC survey, this is by far the largest sample of shear-selected clusters, for which the selection solely depends on gravity and is free from any assumptions about the dynamical state and complex baryon physics. Informed by the optical counterparts, the shear-selected clusters span a redshift range of z≲0.7 with a median of z≈0.3. The lensing sources are securely selected at z≳0.7 with a median of z≈1.3, leading to nearly zero cluster member contamination. We carefully account for (1) the bias in the photometric redshift of sources, (2) the bias and scatter in the weak-lensing mass using a simulation-based calibration, and (3) the measurement uncertainty that is directly estimated on the aperture-mass maps using an injection-based method developed in a companion paper (Chen et al. submitted). In a blind analysis, the fully marginalized posteriors of the cosmological parameters are obtained as Ωm=0.50−0.24+0.28, σ8=0.685−0.088+0.161, Ŝ8≡σ8(Ωm/0.3)0.25=0.835−0.044+0.041, and σ8Ωm/0.3=0.993−0.126+0.084 in a flat ΛCDM model. We compare our cosmological constraints with other studies, including those based on cluster abundances, galaxy-galaxy lensing and clustering, and Cosmic Microwave Background observed by Planck, and find good agreement at levels of ≲2σ. [abridged]