We prove an analogue of a theorem of Eskin-Margulis-Mozes [10]: suppose we are given a finite set of places S over Q containing the archimedean place and excluding the prime 2, an irrational isotropic form q of rank n ≥ 4 on QS, a product of p-adic intervals Ip, and a product Ω of star-shaped sets.We show that unless n = 4 and q is split in at least one place, the number of S-integral vectors v ∈ TΩ satisfying simultaneously q(v) ∈ Ip for p ∈ S is asymptotically given by λ(q, Ω)|I| · T n−2 ,as T goes to infinity, where |I| is the product of Haar measures of the p-adic intervals Ip.The proof uses dynamics of unipotent flows on S-arithmetic homogeneous spaces; in particular, it relies on an equidistribution result for certain translates of orbits applied to test functions with a controlled growth at infinity, specified by an S-arithmetic variant of the α-function introduced in [10], and an S-arithemtic version of a theorem of Dani-Margulis [7].The proof of Theorem 1.5 rests upon a number of ingredients. We will use the dynamics on G/Γ, where G = SL n (Q S ) and Γ = SL n (Z S ), which can be identified with a set L S of unimodular S-lattices. First, we will relate the counting problem to a question about the asymptotic behavior of integrals of the form K f (a t k∆)dm(k), where K is a maximal compact subgroup of SO(q), x is an element in G/Γ related to q, m is the normalized Haar measure of K, and a t is a 1-parameter diagonal subgroup of SO(q) (see Equation (3) in Section 2.3). Here, f is the Siegel transform of a compactly supported function f defined on Q n S (see Definition 3.7). Such integrals, when f is replaced by a bounded continuous function can be dealt with using an S-arithmetic version of the results in [7], which we will state and prove in Section 6 of this paper.Since f is unbounded, in order to use the equidistribution result just described, one needs to also control the integral of f (a t k∆) when a t k∆ is far into the cusp. As in [10], this is dealt with using the function α S (see section 3.6), which is an analog of α introduced in the previous subsection. We prove Theorem 1.7. With the notation as above, assume that q is not exceptional. For 0 < s < 2 and for any S-lattice ∆ ∈ L S , sup t≻1 K α S (a t k∆) s dm(k) < ∞.Moreover, the bound is uniform as ∆ varies over a compact subset C of L S .