A search for the pair production of heavy vectorlike partners T and B of the top and bottom quarks has been performed by the CMS experiment at the CERN LHC using proton-proton collisions at √s = 13 TeV. The data sample was collected in 2016 and corresponds to an integrated luminosity of 35.9fb-1. Final states studied for TT production include those where one of the T quarks decays via T → tZ and the other via T → bW, tZ, or tH, where H is a Higgs boson. For the BB case, final states include those where one of the B quarks decays via B → bZ and the other B → tW, bZ, or bH. Events with two oppositely charged electrons or muons, consistent with coming from the decay of a Z boson, and jets are investigated. The number of observed events is consistent with standard model background estimations. Lower limits at 95% confidence level are placed on the masses of the T and B quarks for a range of branching fractions. Assuming 100% branching fractions for T → tZ, and B → bZ, T and B quark mass values below 1280 and 1130 GeV, respectively, are excluded. 7copy; CERN for the benefit of the CMS collaboration 2019.