We use star counts from 17 deep fields imaged with the Wide Field Came
ra 2 (WFC-2) as part of the HST Medium Deep Survey key project in orde
r to constrain the amount of dark matter in the Galaxy that can be in
the form of low-mass main-sequence stars or white dwarfs. Based on the
number of red stars found in our fields, we exclude the possibility t
hat more than 15 per cent of the massive dark halo in the Galaxy is ma
de up of M dwarfs or subdwarfs; fairly massive (M similar to 0.2 M.) a
nd yet extremely faint (M(I) greater than or similar to 14.5) stellar
candidates would have to be invoked in order to make the observed numb
er of stars compatible with that predicted by a stellar dark halo. Whi
te dwarfs must also be intrinsically very faint (M(I) greater than or
similar to 14) in order to be consistent with the observed number of f
aint stars in the HST fields. We rule out an increasing or flat stella
r luminosity function beyond M(V) similar to 13. The inferred disc lum
inosity function is intermediate between that derived with complete pa
rallax samples of nearby stars and the results of photometric studies
of more distant ones. Finally, the magnitude counts are well fitted by
existing models for the structure of the Galaxy, except for an excess
of stars with 23 < I < 23.5. The colour distribution, however, is not
as well reproduced by the models, especially if the thick disc compon
ent is neglected. However, the overall agreement between models and th
e data precludes the need to add any significant new stellar populatio
n to the ones assumed to exist.