OPINION OF THE COURT
ADAMS, Acting Chief Judge.Appellants, two state prison inmates, brought this suit under the federal civil rights act challenging certain prison regulations as violative of their first amendment rights. Specifically, they allege that the regulations, which prevent them from attending weekly religious services, infringe their right freely to exercise their chosen faith. The district court, 595 F.Supp. 928 (1984), after a hearing, found no constitutional violation. It therefore denied appellants’ request for injunctive relief and dismissed their claims for damages. The prisoners’ appeal was originally heard before a panel of this Court, which decided it under the standard set forth in St. Claire v. Cuyler, 634 F.2d 109 (3d Cir.1980). That standard has governed inmates’ challenges to prison regulations on religious grounds in this Court since St. Claire was decided. However, there has been an increasing concern that the St. Claire test provides inadequate protection for the rights of prisoners freely to exercise their religion. Because of this concern, rehearing in banc was granted for the purpose of reconsidering the St. Claire standard. We now conclude that St. Claire should be modified. The judgment for defendants will therefore be vacated and the matter remanded to the district court to be reconsidered in light of the standard articulated in this opinion.
I.
Ahmad Uthman Shabazz and Sadr-UdDin Mateen, the appellants here, are inmates at the New Jersey State Prison at Leesburg, and are members of the Islamic faith. Leesburg is a medium security prison and work institution, which houses prisoners and trains them to engage in various programs to produce goods and. provide services for the state.
Prisoners at Leesburg are assigned to one of three custody classifications: maximum security, gang minimum, or full minimum. These classifications determine the jobs and work locations to which the prisoners are assigned. Maximum security prisoners are given tasks that are performed within the main building. Gang minimum inmates work at job sites outside the gates of the main building but must remain under the supervision of a corrections officer at all times. Prisoners within the full minimum classification also work outside the main building, but under minimal supervision, and are housed at a minimum security facility known as the Farm. Both Shabazz and Mateen were classified gang minimum when this suit was filed; in May 1984, Mateen was reclassified as a full minimum prisoner and transferred to the Farm.
At issue here is the right of minimum-security Muslim prisoners to attend Jumu’ah, the weekly religious service of the Muslim faith, when there is no evidence that their attendance in the past posed any threat to security. Jumu’ah is held at noon every Friday, as it must take place after the sun reaches its apex and before the Asr, or mid-afternoon prayer. It is the only Muslim congregational service of the week, is commanded by the Qur’an, and cannot be performed at any other time. Concededly, it is a central practice of the Muslim faith.
Jumu'ah services have been held- at the prison since 1979. Prior to the implementation of the regulations challenged here, all prisoners of the Muslim faith were permitted to attend Jumu’ah if they wished. Those gang minimum prisoners who were ordinarily assigned to work details outside *418the main building were assigned to alternative jobs within the main building on Fridays if they expressed a desire to attend Jumu’ah. Full minimum security inmates housed at the Farm were permitted to return by themselves to the main facility in order to attend the services.
In March 1984, however, two changes in correctional policy, one enacted at the state level and one by the officials at Leesburg, éffectively eliminated the opportunity for most Muslim prisoners classified in the two lower security classes to attend Jumu’ah. In April 1983, the New Jersey Department of Corrections issued Standard 853, which required that gang minimum inmates ordinarily be assigned to jobs outside the main building. This resulted in the elimination of the alternative work details on Fridays for Muslim gang minimum prisoners. The prison officials explained Standard 853 as necessary to alleviate the critical overcrowding at Leesburg by reducing the number of inmates working in the main facility during the day.
A second change in prison policy was effected in March 1984, when Leesburg officials issued a memorandum announcing a flat ban on returns to the main facility by prisoners assigned to outside work details. This rule was said to be intended to reduce security and discipline problems by diminishing the burden on prison guards of accounting for and supervising inmates.
The combined effect of the two new regulations was that Muslim gang minimum prisoners could no longer remain inside the main building on Fridays in order to attend Jumu’ah, nor could they return from their outside work assignments to take part in the services. The ban on returns likewise barred most full minimum prisoners from attending Jumu’ah, although those full minimum inmates working near the Farm are permitted to return to that facility to attend a service there. Thus, since April 1983, only those prisoners considered the greatest security risks have been assured of participation in the Muslim services at Leesburg.
Shabazz and Mateen, both lesser security inmates, are precluded from attending Jumu’ah by the prison regulations. They filed this lawsuit against Leesburg prison officials under 42 U.S.C. § 1983 (1982), contending that the regulations infringe their right, guaranteed by the first amendment, freely to exercise their religion. It has been stipulated by all parties that the appellants’ religious beliefs are sincere.
Appellants' claim was evaluated by the district court under the standard articulated in St. Claire v. Cuyler, 634 F.2d 109 (3d Cir.1980). Under the St. Claire test, the state must “produce evidence that to permit the exercise of first amendment rights would create a potential danger to institutional security.” Id. at 114. Such evidence may consist of the expert testimony of prison officials who profess to believe that such a potential danger exists, if the officials’ opinions are “held ‘sincerely’ and [are] arguably correct.” Id. (quoting Jones v. North Carolina Prisoners’ Union, 433 U.S. 119, 127, 97 S.Ct. 2532, 2538, 53 L.Ed.2d 629 (1976)). Once the state has satisfied its burden under the St. Claire analysis, the court must defer to the prison officials’ judgment unless the inmate shows “by ‘substantial evidence ... that the officials have exaggerated their response’ to security considerations ... or that their beliefs are unreasonable.” Id. at 115 (quoting Pell v. Procunier, 417 U.S. 817, 827, 94 S.Ct. 2800, 2806, 41 L.Ed.2d 495 (1974)).
The district judge concluded that the state had met its burden under St. Claire by producing testimony from prison officials that the challenged regulations reduced the strain of overcrowding at Lees-burg and eliminated security problems caused by prisoner returns during the workday. The officials’ opinions were sincere, the court found, and arguably correct. Because appellants failed to show that the policy changes constituted an exaggerated response to security concerns, the district court entered judgment for the defendants. The prisoners filed this timely appeal.
*419II.
Claims by inmates that prison regulations violate their constitutional rights raise difficult problems. Imprisonment necessarily places limits upon many of the constitutional freedoms enjoyed by free citizens. See Jones, 433 U.S. at 125, 97 S.Ct. at 2537; Pell, 417 U.S. at 822, 94 S.Ct. at 2804. It is also true that important state interests are at stake in the prison context, such as the maintenance of institutional security, and the preservation of internal order and discipline. Bell v. Wolfish, 441 U.S. 520, 546, 99 S.Ct. 1861, 1877, 60 L.Ed.2d 447 (1979); Pell, 417 U.S. at 822-23, 94 S.Ct. at 2804. The Supreme Court has stressed repeatedly the importance of judicial recognition of the expertise of prison administrators, and the need for deference to experienced prison officials’ judgment. Bell, 441 U.S. at 547, 99 S.Ct. at 1878; Jones, 433 U.S. at 126, 97 S.Ct. at 2538; Procunier v. Martinez, 416 U.S. 396, 404-05, 94 S.Ct. 1800, 1807, 40 L.Ed.2d 224 (1973).
The Supreme Court has also emphasized, however, that inmates retain those constitutional rights that are not inconsistent with their status as prisoners or with the legitimate penological goals of the corrections system. Jones, 433 U.S. at 125, 97 S.Ct. at 2537; Pell, 417 U.S. at 822, 94 S.Ct. at 2804. While “a healthy sense of realism” may require that federal courts acknowledge their relative incompetence in the area of prison administration, Procunier, 416 U.S. at 405, 94 S.Ct. at 1807, it is also understood that “[w]hen a prison regulation or practice offends a fundamental constitutional guarantee, federal courts will discharge their duty to protect constitutional rights.” Id. at 405-06, 94 S.Ct. at 1807-08; see also Cruz v. Beto, 405 U.S. 319, 321, 92 S.Ct. 1079, 1081, 31 L.Ed.2d 263 (1972) (per curiam); Johnson v. Avery, 393 U.S. 483, 486, 89 S.Ct. 747, 749, 21 L.Ed.2d 718 (1969). As stated by the Supreme Court in Wolff v. McDonnell, 418 U.S. 539, 556, 94 S.Ct. 2963, 2974, 41 L.Ed.2d 935 (1974), there must be a “mutual accommodation” between the important institutional objective of security and the constitutionally protected rights of prisoners. See also Bell, 441 U.S. at 546, 99 S.Ct. at 1877.
However, the standard articulated in St. Claire does not call for such an accommodation. Rather, under St. Claire, a mere declaration by prison officials that certain religious practices raise potential security concerns is sufficient to override a prisoner’s first amendment right to attend the central religious service of his faith. The prison officials are not required to produce convincing evidence that they are unable to satisfy their institutional goals in any way that does not infringe the inmates’ free exercise rights. Nor do they carry a burden of showing that bona fide security problems occurred or are likely to arise because of the religious practice at issue.
The flaw in the St. Claire standard is well illustrated by the facts presented in this case. The prison officials here do not claim that attendance at Jumu’ah is an inherently dangerous practice. Indeed, they could not, as attendance was permitted for all Muslim prisoners until the March 1984 implementation of the new regulations and there is no suggestion that such attendance resulted in any harm. Rather, defendants merely assert that security problems caused by overcrowding and understaffing necessitated the policy changes that outlawed attendance at Jumu’ah for nearly all but the maximum security prisoners. Although appellants suggested alternative methods of allocating work assignments that would both satisfy defendants’ security concerns and hon- or the prisoners’ wish to participate in Jumu’ah services, the prison administrators rejected these suggested solutions. They assert that any such accommodations would raise new security problems.1 Yet, *420under St. Claire, the state was under no burden to establish that such security concerns were genuine and were based upon more than speculation.
We do not here resolve the validity of defendants’ contention that accommodation of the prisoners’ religious rights cannot be accomplished without damage to institutional security.2 Nor do we reach the ultimate question whether the prison regulations challenged here impermissibly impinge upon the plaintiffs’ religious rights. We conclude only that the St. Claire standard, which did not require any inquiry into the feasibility of accommodating prisoners’ religious practices, provides inadequate protection for their free exercise rights and therefore must be modified. Accordingly, we hold that, upon remand, the state must show that the challenged regulations were intended to serve, and do serve, the important penological goal of security, and that no reasonable method exists by which appellants’ religious rights can be accommodated without creating bona fide security problems.3 The expert testimony of prison officials should be given due weight, but such testimony is not dispositive of the issue whether no reasonable adjustment is possible. Thus, in resolving a motion for summary judgment in a case challenging prison regulations as violative of the free exercise clause, the district court must take into account all materials tendered in opposition thereto that raise genuine issues of material fact. Where it is found that reasonable methods of accommodation can be adopted without sacrificing either the state’s interest in security or the prisoners’ interest in freely exercising their religious rights, the state’s refusal to allow the observance of a central religious practice cannot be justified and violates the prisoners’ first amendment rights.4
The dissent complains that the test articulated here fails to give adequate weight to the principle of deference stated by the Supreme Court in its cases addressing prisoners’ constitutional rights. We disagree. Federal courts must afford deference to decisions by prison officials in areas concerning security, but where first amendment values are implicated such deference must be tempered by an effort to accommodate free exercise values.
Further, none of the Supreme Court cases cited by the dissent as requiring deference to the arguably correct opinions of prison officials involved a practice that lies at the core of an explicit constitutional guarantee, such as the right to attend religious services central to the prisoners’ faith. Cases concerning rights of association or privacy provide uncertain guidance in resolving the clash of interests presented here. Thus, while we are not unaware of the role that the deference principle has played in the Supreme Court’s opinions regarding prisoners’ rights, and indeed subscribe to that principle, we seek only to ensure that it does not deprive prisoners’ free exercise rights of all content.
*421III.
We recognize that the record in this case reveals particularly strong interests both on the part of the prisoners and on the part of the prison administrators. The regulations challenged here prohibit inmates whose religious beliefs are conceded to be sincere from attending the only weekly service of their faith. Furthermore, there is no indication that participation in Jumu’ah services by lesser security prisoners, which was allowed until March 1984, caused security problems. However, the security problems identified by the state cannot be disregarded and are worthy of serious consideration. We are mindful of the difficulties inherent in the effort to effect an accommodation that is both sensitive to the sincere religious practices and beliefs of the prisoners and based upon an appreciation of the security problems faced by prison administrators. Nonetheless, such an effort is required under Wolff v. McDonnell and Bell v. Wolfish, and federal courts are not free to abdicate their responsibility to see that a proper accommodation is achieved.
The district court should be given the opportunity to appraise the factors in this case in the light of the test we have adopted here. Therefore, the judgment of the district court will be vacated and the matter remanded for reconsideration under the standard set forth in this opinion.
. The prison officials claim that the assignment of Muslim minimum security prisoners to alternative work details on Fridays would lead to the formation of affinity groups, or work groups consisting entirely of Muslim prisoners. According to the state, affinity groups can raise problems in maintaining order and discipline. We do not decide here the weight to be given to *420evidence concerning affinity groups in this case. However, such evidence may be presented to the district court on remand, for consideration under the standard set forth in this opinion.
. We do. not understand defendants to be arguing that any of the other legitimate penological interests identified in Pell — the deterrence of crime, the rehabilitation of criminals, and the segregation of prisoners from the public— would be threatened by permitting plaintiffs to attend Jumu'ah services. See Pell, 417 U.S. at 822-23, 94 S.Ct. at 2804. Indeed, nothing in the record in any way suggests that precluding prisoners from attending Jumu’ah services furthers any of these goals. What is more, it is difficult to imagine how allowing prisoners to participate in religious services could inhibit deterrence, rehabilitation, or segregation. If anything, it would seem that attendance at religious services might play a role in facilitating inmates’ rehabilitation and their eventual successful return to society.
. Factors such as the endemic crowding in a state’s prisons, the cost of implementing various methods of accommodating prisoners’ religious rights, understaffing, and inmates’ demonstrated proclivity to unruly conduct may be considered in determining whether a potential method of accommodation is reasonable.
. Dreibelbis v. Marks, 742 F.2d 792 (3d Cir. 1984), and Cole v. Flick, 758 F.2d 124 (3d Cir.), cert. denied — U.S. -, 106 S.Ct. 253, 88 L.Ed.2d 260 (1985), must now be read in light of this modification of St. Claire.