We give a q-congruence whose specializations q=-1 and q=1 correspond to supercongruences (B.2) and (H.2) on Van Hamme’s list (in: p-Adic Functional Analysis (Nijmegen, 1996), Lecture Notes in Pure and Applied Mathematics, vol 192. Dekker, New York, pp 223–236, 1997): ∑k=0(p-1)/2(-1)k(4k+1)Ak≡p(-1)(p-1)/2(modp3)and∑k=0(p-1)/2Ak≡a(p)(modp2),\\documentclass[12pt]{minimal}\t\t\t\t\\usepackage{amsmath}\t\t\t\t\\usepackage{wasysym}\t\t\t\t\\usepackage{amsfonts}\t\t\t\t\\usepackage{amssymb}\t\t\t\t\\usepackage{amsbsy}\t\t\t\t\\usepackage{mathrsfs}\t\t\t\t\\usepackage{upgreek}\t\t\t\t\\setlength{\\oddsidemargin}{-69pt}\t\t\t\t\\begin{document}$$\\begin{aligned}&\\sum _{k=0}^{(p-1)/2}(-1)^k(4k+1)A_k\\equiv p(-1)^{(p-1)/2}\\;({\\text {mod}}p^3) \\quad \\text {and}\\quad \\\\&\\sum _{k=0}^{(p-1)/2}A_k\\equiv a(p)\\;({\\text {mod}}p^2), \\end{aligned}$$\\end{document}where p>2 is prime, Ak=∏j=0k-1(1/2+j1+j)3=126k2kk3fork=0,1,2,…,\\documentclass[12pt]{minimal}\t\t\t\t\\usepackage{amsmath}\t\t\t\t\\usepackage{wasysym}\t\t\t\t\\usepackage{amsfonts}\t\t\t\t\\usepackage{amssymb}\t\t\t\t\\usepackage{amsbsy}\t\t\t\t\\usepackage{mathrsfs}\t\t\t\t\\usepackage{upgreek}\t\t\t\t\\setlength{\\oddsidemargin}{-69pt}\t\t\t\t\\begin{document}$$\\begin{aligned} A_k=\\prod _{j=0}^{k-1}\\biggl (\\frac{1/2+j}{1+j}\\biggr )^3=\\frac{1}{2^{6k}}{\\left( {\\begin{array}{c}2k\\\\ k\\end{array}}\\right) }^3 \\quad \\text {for}\\; k=0,1,2,\\ldots , \\end{aligned}$$\\end{document}and a(p) is the pth coefficient of the modular form qprod _{j=1}^infty (1-q^{4j})^6 (of weight 3). We complement our result with a general common q-congruence for related hypergeometric sums.