  We prove the finiteness of the Tate-Shafarevich group (i.e., the BSD
conjecture) for a class of elliptic curves over function fields. This is an
application of a more general theorem that the Tate conjecture in codimension
$1$ is ''generically true'' for mod $p$ reductions of complex projective
varieties with $h^{2, 0} = 1$, under a mild assumption on moduli. We also prove
the Tate conjecture for a class of algebraic surfaces of general type with $p_g
= 1$.
